|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Delete folders in shell script after so many backups
Hi,
I have a backup script which copies the home dir to an external hard drive every 6 hours. What i want to know is if there is a command i can put at the end of my backup script which will only keep the last 4 backups. All the others can be deleted. My dir structure is: -Root --Day ---Daily Backup --Week ---Weekly Backup --Month ---Monthly Backup --6 Hour Backup1 --6 Hour Backup2 --6 Hour Backup3 --6 Hour Backup4 --6 Hour Backup5 --6 Hour Backup6 e.t.c So this means i cant just delete all the directories only the ones which follow the pattern of the 6 hour backups (regexp?) Any ideas? Thanks in advance |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Delete folders in shell script after so many backups |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|