diff --git a/backup_cosmicvoyage b/backup_cosmicvoyage new file mode 100755 index 0000000..eb86360 --- /dev/null +++ b/backup_cosmicvoyage @@ -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 +