Hi,
I am a trainee System Administrator in my company and still a newbie. How do I set the cron job to only show the current week's backup (in the database backup directory) and remove the previous week's backups.
One week would mean Monday to Saturday.
Pls help.
Tqs.
Hi
First create a script like (removeoldbackup.sh) in that script add these lines.
#!/bin/sh
cd /database_backup_directory/
find . -mtime +7 -exec rm -rf {} \;
exit and save file. Then make that file executable. I hope you know about how to make executable.
Then you can set crontab as per your requirement.
That is...