Hello 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. Problem is I need help to do this problem. I am assuming you have to edit the crontab file? (a guess).
linux cron: want to backup a folder
backup;cron
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*:#!/bin/bashcd /usr/local/src/djcode/tar zcf /home/sh/c2duo_mms-`date +%Y%m%d`.tar.gz c2duo_mmsBe sure to add the executable permission to the script:chmod +x /home/sh/c2duo_mms_backup.shThen add the relevant crontab entry with the crontab -e command:0 13 * * 2 /home/sh/c2duo_mms_backup.shThe 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: c2duo_mms_20110719.tar.gz 