automatic backup a folder
Hi i want to make script that automatically start and take a backup of a particular folder.
to backup folder1 path folder2 |
Most distro's have crontab configured to run scripts in the /etc/cron.* directories at the correct time, like every hour,day or week.
So if you want to backup a directory every day, you would put your backup script in the directory /etc/cron.daily for the command in the script file to make the actually backup I would advice to checkout rsync. It should have come with your distro. |
have you created a script that will backup the directory to the destination you desire in the way you want to back it up? if so then as user you can create a crontab -e (the -e = edit) and put in something like this:
Code:
0 21 * * * /path/to/script you might have to give the user permissions to run its own cronjob by adding the user name to /etc/cron.allow or were ever that file is located on your distro. what gdejonge said about rsync is great, but keep in mind that has to be run as root. if you just want to cp, not as clean as rsync mind you, or tar the directory to save space then user rights are just fine. |
All times are GMT -5. The time now is 11:06 AM. |