backup all files,not just *.txt and license (also . files)
fix checking of old archive, this was not working correct
This commit is contained in:
parent
3fb4e9988d
commit
23f06aa469
|
@ -24,22 +24,21 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "backing up $SHIPS/* to $TGZ"
|
||||
|
||||
tar cvfz $TGZ */*.txt */LICENSE
|
||||
# have to use */* since it would otherwise backup the symlinks and not
|
||||
# the target, maybe we could use an option in tar otherwise
|
||||
|
||||
tar cvfz $TGZ */* */.??*
|
||||
|
||||
# don't keep backup file if nothing has changed
|
||||
|
||||
if [ -f "$OLDBACKUP" ]
|
||||
if [ -f "$OLDBACKUP" ] && cmp -s "$OLDBACKUP" $TGZ
|
||||
then
|
||||
if cmp -s "$OLDACKUP" $TGZ
|
||||
then
|
||||
echo "file is different, keeping new file"
|
||||
else
|
||||
echo "nothing has changed, no new backup"
|
||||
rm -f $TGZ
|
||||
fi
|
||||
echo "nothing has changed, no new backup"
|
||||
rm -f $TGZ
|
||||
else
|
||||
echo "file is different, keeping new file"
|
||||
fi
|
||||
|
||||
test -f $TGZ && echo backup of file $TGZ was successful
|
||||
|
|
Loading…
Reference in New Issue