G'day All,
I've been looking around at backup utilities like Mondo but realised what I want to do probably has a simpler answer. All I want to to is copy files from /home that have changed since the last backup to another drive mounted as /home.bak.
Cron? all suggestions appreciated.
Thanks,
build
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Simple backup copying to another HDD
It can be done with a script like this:
or this way:
These examples take granted you never touch /home.bak by hand, I mean, you don't create a file in it, and you don't edit any files in it. If you do, it won't work, because it copies all files which was changed later than the /home.bak directory. If you touch the directory by changing one of the files in it, these will fail.
See the man page of find for more info and for the possible switches and tests.
Code: Select all
cd /home
for file in `find . -mindepth 1 -newer /home.bak`; do
cp -r $file /home.bak/
done
Code: Select all
cd /home
find . -mindepth 1 -newer /home.bak -exec cp -r \{\} /home.bak \;
See the man page of find for more info and for the possible switches and tests.
backup
Thanks to you both. I like both answers but don't fully comprehend the bash.
With rsync is it really as simple as: # rsync -r /home/ /home.bak
looks far too easy.
(this R3.1 debian is really getting far tooo easy, not scary geeky stuff at all
cheers
build
With rsync is it really as simple as: # rsync -r /home/ /home.bak
looks far too easy.
(this R3.1 debian is really getting far tooo easy, not scary geeky stuff at all
cheers
build
Last edited by build on 2006-07-29 22:53, edited 1 time in total.
G'day All,
I ended up with a crontab entry of: 0 * * * * rsync -rogv --delete /home/ /home.bak to back up every hour.
The -r being recursive, -o & -g to preserve owner and group, the -v for verbose and --delete to delete obsolete files. However the -v is not providing a list of files printed to the screen and syslog has only the cron entry. Where is the output of verbose to be found?
Thanking you in anticipation.
btw, is the crontab entry correct? Is there a better way of doing it? Is there any other options I should be using? Thx
I ended up with a crontab entry of: 0 * * * * rsync -rogv --delete /home/ /home.bak to back up every hour.
The -r being recursive, -o & -g to preserve owner and group, the -v for verbose and --delete to delete obsolete files. However the -v is not providing a list of files printed to the screen and syslog has only the cron entry. Where is the output of verbose to be found?
Thanking you in anticipation.
btw, is the crontab entry correct? Is there a better way of doing it? Is there any other options I should be using? Thx
-
- Posts: 113
- Joined: 2006-05-08 05:49
I tried the command... # rsync -r /home/ /copyhome and I got a stream of messages... 'skipping non-regular file "<filename>".
What does this tell me.
The copy DID get put into my 2nd drive like I wanted.
Now, assuming this DID work right, the next time I run # rsync -r /home/ /copyhome, the /copyhome will be updated with everything that has changed and only everything that has changed, right?
What does this tell me.
The copy DID get put into my 2nd drive like I wanted.
Now, assuming this DID work right, the next time I run # rsync -r /home/ /copyhome, the /copyhome will be updated with everything that has changed and only everything that has changed, right?