Created
June 17, 2014 09:18
-
-
Save kunpengku/d8dbcc254aba5c91c6eb to your computer and use it in GitHub Desktop.
备份最近一天的文件
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 | |
BACKUPFILE=backup.$(date +%Y%m%d) | |
archive=${1:-$BACKUPFILE} | |
tar cvf - `find -mtime -1 -type f -print` > $archive.tar | |
# find . -mtime -1 -type f -exec tar rvf "$archive.tar" '{}' \; | |
gzip $archive.tar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment