Automatically backs up files in Linux to Windows

Source: Internet
Author: User
Automatically Back Up Files in Linux to Windows-Linux general technology-Linux technology and application information. The following is a detailed description. 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.
CODE :#! /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 ready before 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

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.