Skip to content

Instantly share code, notes, and snippets.

@colegleason
Last active August 20, 2020 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colegleason/2a2cdfe4285b88964c321b8f6e19dea6 to your computer and use it in GitHub Desktop.
Save colegleason/2a2cdfe4285b88964c321b8f6e19dea6 to your computer and use it in GitHub Desktop.
Zip all subdirectories that are older than a year old, remove source files after zip
find . -type d -mtime +365 -maxdepth 1 -exec zip -mr {}.zip {} \;
rsync --remove-source-files -ah --info=progress2 *.zip /Volumes/Shared\ Data/Code\ Backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment