-----Original Message----- From: Mike Rees [SMTP:suse@glanymor.carms.sch.uk] Sent: Monday, July 23, 2001 9:34 AM To: suse-linux-uk-schools@suse.com Subject: [suse-linux-uk-schools] selective tar backups
Hi
I'm trying to automate some of my backup processes using tar within a cron job.
For example, I want to backup only certain file types from a user's home directory such as documents, presentations etc. [Simon Wood] Note that Linux doesn't really on the '.suffix' method for identifying file types, and it is possible that your users may use simple names for their documents, resulting in them not being backed up.
At present I've got this command running every night tar cvfz /backup/$(date +%d%m%y)home.tar /home which saves everything (backup is a smb mounted share on another server) [Simon Wood] I've been looking (in a much simpler environment - at home) into doing a weekly full backup and then a daily delta.
Any ideas how I can be more selective? [Simon Wood] how about....
1) Create an empty archive. tar cf backup_date.tar [hmmm refuses to create an empty archive, though this seems to work.... touch backup_date.tar ] 2) Use 'find' to track down the appropriate files, either repeat for different file types (or work out how to specify this in 'find' ;-) ) find /home -name '*.doc' -exec tar rf backup_date.tar {} \; 3) Compress when done. gzip backup_date.tar