Created
October 2, 2016 22:37
-
-
Save potatoru/12d42080b18de49afe8ca691deb24db1 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/sh | |
shares=( | |
'000 - Document Database' | |
'001 - Administrative' | |
'002 - Construction' | |
'003 - HSE' | |
'004 - Material' | |
'005 - QC' | |
'006 - PDDM' | |
'007 - Project Control' | |
'008 - Management' | |
'009 - Additional Work Log' | |
'010 - QC E&I' | |
'999 - Common' | |
) | |
storage='/mnt/HD_a2' | |
date=`date +"%d-%m-%Y"` | |
for share in "${shares[@]}" | |
do | |
filename="[$date] $share.tar" | |
tar -cf "$storage/backup/$filename" "$storage/$share" | |
done | |
tar -cf "$storage/backup/[$date] etc.tar" "/etc" | |
find "$storage/backup/" -maxdepth 1 -mtime +2 -type f -exec rm -rv {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment