Batch backup folder under Linux

Source: Internet
Author: User

Working under Linux, how can I make more convenient backups of previous work? Every time we go to the command pack? The best way of course is to use the powerful shell under Linux.
Here is a simple example I wrote to back up the shell scripts for two folders floderName1 and floderName2. Each backup is distinguished by the system time at which it was backed up. You can add your own code if you need to, of course, if there are rules between these folders is better.

#!/bin/shflodername1=flodername1backupname1= $floderName 1-' Date +%y%m%d%h%m '. tar.bz2 backuppath1=/mnt/tar/$ FLODERNAME1TAR-CJVF $backupName 1 $floderName 1mv $backupName 1 $backupPath 1
flodername2=flodername2backupname2= $floderName 2-' date +%y%m%d%h%m '. tar.bz2 backuppath2=/mnt/tar/$floderName 2tar- CJVF $backupName 2 $floderName 2mv $backupName 2 $backupPath 2


Batch backup folder under Linux

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.