Files in Linux are automatically backed up to Windows.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.