| | |
Cut off every 7 days
![]() |
•
•
Join Date: Jun 2008
Posts: 25
Reputation:
Solved Threads: 0
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.
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.
Last edited by Aigini; Oct 27th, 2009 at 3:35 am.
•
•
Join Date: Oct 2009
Posts: 12
Reputation:
Solved Threads: 0
0
#2 Oct 27th, 2009
•
•
•
•
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.
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...
![]() |
Similar Threads
- urllib2 fetching different page than browser (Python)
- News Story: Internet cable cut conspiracy (Network Security)
- Cut and paste doesn't work (Windows 95 / 98 / Me)
- Microphone problem (USB Devices and other Peripherals)
- OLD Mac fans? (pre OS X) (Apple Hardware)
- You know you're getting older (Geeks' Lounge)
- Takes time to copy,cut,paste or delete (Windows 95 / 98 / Me)
- IE 6.0 doesn't show address bar, pull-down menu & short-cut icons when opened (Windows NT / 2000 / XP)
- I can't browse with internet explorer (Windows NT / 2000 / XP)
Other Threads in the *nix Software Forum
- Previous Thread: Are There Any Good Emulators For XBox 360?
- Next Thread: What Free Software Means
| Thread Tools | Search this Thread |
Tag cloud for *nix Software
2005 apache bashscripting busybox cert codeplex debian dotnetnuke emacs forwarding free fsf gaming gnu government gpl lawsuits license linux ls mail make makefile mandriva microsoft mkisofsiso obama open opensource port postfix ps3 samba security server sflc sharing software source stallman subdirectory ubuntu unix vmware xbox





