Article Title: files in Linux are automatically backed up to Windows. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
If/dev/hda1 is the fat32 partition in windows, then mkdir/mnt/win_c,/var/www is the directory you want to back up
Write the following script, save it as/root/backup_var_www.sh, and add the execution permission.
#! /Bin/bash if! Grep-q '/dev/hda1'/proc/mounts then mount/dev/hda1/mnt/win_c | exit fi backup_ball = "/mnt/win_c/var_www _ $ (date when using f).tar.bz2 "if tar jcf $ backup_ball/var/www then echo" $ backup_ball backup succeeded. :) "| mail-s" backup OK "root else echo" $ backup_ball backup failed. :( "| mail-s" backup FAILED "root fi
|
Then crontab-e
Join
30 4 ** 5/bin/bash/root/backup_var_www.sh
That is, the backup operation is performed at every Friday.