Here's one for the bash-fu wizards. No, actually, I'm just kidding, you'll all probably know this except for me..

I'm trying to create a backup shell script. The idea is fairly simple: find files in a certain folder, older than 7 days, tar/gzip them to another directory, and remove them. The problem is, I'm not sure if I'll have enough permissions to create a tar/gzip file in the target dir. Is there any (proper) way to check if the file has been created successfully, and if so, delete the files. Otherwise, skip that part and don't destroy customers' data. I hear they are not very fond of that.

Thanks for your answer. It is highly unlikely that a file will fit between invocations, since this script will run at 4AM when no files should be created in the folder I'm backing up. Of course, there's always that one user..
–
dr Hannibal LecterMar 2 '10 at 13:28