Corrected Incremental backupscript
Nov. 12th, 2017 06:05 pmThis wasn't quite working the way it should have. Now it will correctly implement incremental backups of the home directory on Unix, Mac OSX and Linux systems.
#!/bin/bash
cat << here
-----------------------------------------------------------------------------
Sinister Porpoise Computing Backup Script
Test script for creating multiple
backup files.
Lara Landis
11/10/2017
Personal Bash Script
----------------------------------------------------------------------------
here
echo "Now creating backup files..."
x=1
y=1
if [[ -f "backup.tar.gz" ]]; then
x=1
if [[ -f "backup${y}.tar.gz" ]]; then
while (x=1)
do
if [[ -f "backup${y}.tar.gz" ]]; then
x=1
y=y+1
fi
done
elif [[ ! -f "backup${y}.tar.gz" ]]; then
tar -czvf "backup${y}.tar.gz" /home
fi
else
tar -cvzf "backup.tar.gz" /home
fi