Skip to content

Instantly share code, notes, and snippets.

@meysampg
Last active August 29, 2016 04:35
Show Gist options
  • Save meysampg/dad68561c639ec3c5675dd83901921c6 to your computer and use it in GitHub Desktop.
Save meysampg/dad68561c639ec3c5675dd83901921c6 to your computer and use it in GitHub Desktop.
Remove Old Backup Folders
# Replace PATH_OF_BACKUP_FOLDER with path of backup folder, for example /mnt/CRM/backup
# Replace NUMBER_OF_DAYS with a positive integer, for example 14 means folder older that 14 days.
find PATH_OF_BACKUP_FOLDER -maxdepth 1 -type d -ctime +NUMBER_OF_DAYS -printf "'%p' \n" | xargs rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment