Created
July 2, 2019 00:21
-
-
Save ziozzang/44e1dd6b7b6104c2b506728fa7413bd3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| # ./tar-diff.sh dir_name_here 8 | |
| DIR_NAMES=${1:-"asdf"} | |
| DAYS=${2:-"8"} | |
| LASTDATE=`(date --date "${DAYS} days ago" --rfc-3339=seconds)` | |
| TIMESTMP=`date '+%Y-%m-%d'` | |
| tar -cvz --newer-mtime="${LASTDATE}" -f ${DIR_NAMES}-diff-${TIMESTMP}-${DAYS}d.tgz ${DIR_NAMES} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment