Script programing
Ok I have a programming question.
I have 2 hard drives in my box which acts as a server. The first hard drive is running redhat 9 the 2nd has nothing on it. I want to write a script that will once a day make a folder on HD2 name it today’s date and copy all information from /home on it. Any ideas? Just a bit of background on this. The server is at a clients and they don’t want to pay for RAD or any kind of tape drive. -AG |
you could run something like this as cron job
Code:
#/bin/sh |
One minor note: use:
Code:
date -I Lyle |
Have you considered CVS?
It would save a ton of space by saving the changes rather than saving the entire directory structure each night? |
I am sorry guys i was not quite as clear on this as i should have been. On top of copying /home into a backup directory on HD2 i would like it to have the old directorys deleted every 2 weeks. This way i can go back 2 weeks incase some one accadently saved changes to a file that they did not want to or some thing like that.
|
Here's something you can try. Be very careful with it because it uses rm -Rf at one point.
Code:
#!/bin/bash I use rdiff-backup; see http://rdiff-backup.stanford.edu/. I have a year's worth of backups. My home directory (today) is 1.2GB, one years worth of backups is 4.3GB, so it's pretty effecient disk-space wise. I'd recommend using that instead of the above script. Lyle |
Thanks, Lyle. I will give it a try and let you know how it worked.
-AG |
All times are GMT -5. The time now is 09:24 AM. |