Arne, Thanks for the comprehensive reply, a few more questions follows: On Mon 9 February 2004 19:49, Arne Vogel wrote: > Paul Stear wrote: > >Hi all, > >I have been working on a backup solution for my home system and have a > > full backup of /home and then incremental backups for the rest of the > > week. I know how to uncompress and and action the full backup, but have 2 > > questions regarding the incremental. > >The incremental only tar the files that have changed or are new, which is > > what I want, however, my script also saves empty directories, which I > > don't want. 1. How can I exclude empty directories? > > That's a tricky question since we can't look at your script, but if > you're using the Bourne shell (sh or bash), > you could use > > if ls "$DIR" | grep ^ >/dev/null; then > # directory "$DIR" is not empty > else > # directory "$DIR" is empty > fi > This will not cover nested directories though, e.g. if directory x > contains only directory y, and directory y is > empty, x will not be regarded as empty, too.
Thanks, That will do nicely. I have done some more testing and it appears that expanding the full backup tar followed by the incremental puts everything back to normal, even if the dir's on the incremental were empty, so I think in view of your comments about nesting it will be safer to leave as is. <snip> > You would need to store the information which files and directories were > removed as well in your incremental backups. I never thought of this. How do you recognise deleted files or directories? The only thing I can think of is from the trash dir in kde desktop, which I am excluding from the backup at present. If I saved these in the backup tar I would need to remove them from trash when the script has run so it was clean for the next day. How would I use these files to delete the correct files during the untar process? <snip> > I would strongly recommend against actually deleting files from home > directories, moving them to a temporary > directory where you can manually sift through them seems much wiser. > I might have a look at this but I wanted to create my own as an exercise to keep the grey cells working. > Maybe however you'll find it simpler and safer to use BackupPC > (http://backuppc.sourceforge.net) instead. > I can't tell you much about it though since I'm looking forward to using > it the first time, too. Paul PLEASE NOTE, Only text messages will be downloaded, others will be deleted at the server. This message was sent using gentoo linux and kmail. -- [EMAIL PROTECTED] mailing list
