Created
January 10, 2013 03:14
-
-
Save necrogami/4499130 to your computer and use it in GitHub Desktop.
This will create 7z files that are based on the last modified date of the file and it will create an archive for each date and add files to them.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARCHIVE_FOLDER=/path/to/archive/location | |
for i in `find -type f -mtime +14` | |
do | |
mod=$(date -d"$(stat --printf='%y\n' $i)" +%Y%m%d) | |
7za a $ARCHIVE_FOLDER/$mod.7z $i | |
echo "Processed: " $i | |
rm $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment