Created
May 7, 2020 14:54
-
-
Save ItsEmilyJpg/4ad8cc4f61121df697bbacdffd038b87 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 | |
| SOURCE=/root/gitlab/ | |
| DESTINATION=/root/backup/ | |
| # not modify below | |
| DATE_DAILY=`date '+%d-%m-%Y_%H-%M-%S'` | |
| tar -cvzf $DESTINATION/$DATE_DAILY.tar $SOURCE | |
| # daily - keep for 14 days | |
| find $DESTINATION/ -maxdepth 1 -mtime +14 -type d -exec rm -rv {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment