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:
Alexander 2023-01-24 12:08:59 +00:00
parent 3fb4e9988d
commit 23f06aa469
1 changed files with 9 additions and 10 deletions

View File

@ -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