I would like to backup a folder using cron on a centos. The folder c2duo_mms
is located in /usr/local/src/djcode/c2duo_mms
. I would like it backed ip every 1:00pm on Tuedays to my home folder /home/sh
.
Linux cron: want to backup a folder
backupcron
Best Answer
A good thing to do would be to create a new compressed archive in your home.
Create this script named for exmaple */home/sh/c2duo_mms_backup.sh*:
Be sure to add the executable permission to the script:
Then add the relevant crontab entry with the crontab -e command:
The script will create a new compressed archive every Tuesday with the date in the filename, so that you can keep older backups if you want. File name will look like this: