Compare commits
2 Commits
d0257e3743
...
a9abe4bec1
Author | SHA1 | Date |
---|---|---|
Alexander | a9abe4bec1 | |
Alexander | 382ee61ed7 |
|
@ -1,3 +1,4 @@
|
|||
# emacs backups
|
||||
|
||||
*~
|
||||
\#*\#
|
||||
|
|
10
README.md
10
README.md
|
@ -1,4 +1,10 @@
|
|||
# cosmicvoage-backup
|
||||
|
||||
A simple script to backup the cosmic voyage files dir to a dir in the home dir
|
||||
|
||||
A simple script to backup the cosmic voyage files dir to a dir in the home dir
|
||||
|
||||
To use the script, either run in manually or put it into your crontab
|
||||
|
||||
$ crontab -e
|
||||
|
||||
0 1 * * * $HOME/bin/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
|
||||
|
Loading…
Reference in New Issue