first commit
This commit is contained in:
parent
d0257e3743
commit
382ee61ed7
|
@ -0,0 +1,21 @@
|
|||
#! /bin/bash
|
||||
|
||||
SHIPS=~/ships
|
||||
BACKUP=~/backup-ships
|
||||
|
||||
test -d $SHIPS || (echo "ships does not exit" ; exit 1)
|
||||
|
||||
test -d $BACKUP || mkdir $BACKUP
|
||||
|
||||
cd $SHIPS
|
||||
|
||||
TS=`date -u +%Y-%m-%dZ%H:%M`
|
||||
|
||||
TGZ="$BACKUP/ships-$TS.tar.gz"
|
||||
|
||||
echo backing up $SHIPS to $TGZ
|
||||
|
||||
tar cvfz $TGZ */*.txt */LICENSE
|
||||
|
||||
test -f $TGZ && echo backup of file $TGZ was successful
|
||||
|
Loading…
Reference in New Issue