marjoh05
April 25th, 2013, 08:31 AM
I found some script online i need to use for backup purpose. I have a windows server that transfer daily backup to my ubuntu 12.04 server. Because Windows Server Backup wont save more than one backup at once to a shared folder i have a script that weekly copy and rename(renames with the date) and puts it in another folder. The only problem is that the HDD gets pretty full after some months, so i need a script that deletes every file thats older than 4 weeks, but wont delete any if there isnt any more files added(if the backup stops working).
Found a script that deletes all files who is older than 3 days: how can i set it to 4 weeks? Or how can i set it to not delete files when its 4 or less folders in my weekly backup folder?
find /u1/database/prod/arch -type f -mtime +3 -exec rm {} \;
Thanks :-)
Found a script that deletes all files who is older than 3 days: how can i set it to 4 weeks? Or how can i set it to not delete files when its 4 or less folders in my weekly backup folder?
find /u1/database/prod/arch -type f -mtime +3 -exec rm {} \;
Thanks :-)