made backup report successful with read errors. these are mostly permission based
This commit is contained in:
@@ -105,9 +105,11 @@
|
|||||||
echo "Backing up... to misamisa"
|
echo "Backing up... to misamisa"
|
||||||
echo "Date: $(date '+%Y-%m-%d_%H-%M-%S')" # Add your Restic backup command here
|
echo "Date: $(date '+%Y-%m-%d_%H-%M-%S')" # Add your Restic backup command here
|
||||||
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) backup $backupdir
|
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) backup $backupdir
|
||||||
if [ $? -eq 0 ] || [ $? -eq 3 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# If the exit status is 0 (success), send a success message
|
# If the exit status is 0 (success), send a success message
|
||||||
./discord.sh "$(hostname) backup complete"
|
./discord.sh "$(hostname) backup complete"
|
||||||
|
elif [ $? -eq 3 ]; then
|
||||||
|
./discord.sh "$(hostname) backup complete"
|
||||||
else
|
else
|
||||||
# If the exit status is not 0 (failure), send a failure message
|
# If the exit status is not 0 (failure), send a failure message
|
||||||
./discord.sh "$(hostname) Backup has failed"
|
./discord.sh "$(hostname) Backup has failed"
|
||||||
@@ -119,7 +121,7 @@
|
|||||||
echo "Removing old backups..."
|
echo "Removing old backups..."
|
||||||
# Add your Restic forget command here
|
# Add your Restic forget command here
|
||||||
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) forget --keep-within-daily 7d --keep-within-weekly 1m --keep-within-monthly 1y
|
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) forget --keep-within-daily 7d --keep-within-weekly 1m --keep-within-monthly 1y
|
||||||
if [ $? -eq 0 ] || [ $? -eq 3 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# If the exit status is 0 (success), send a success message
|
# If the exit status is 0 (success), send a success message
|
||||||
./discord.sh "$(hostname) forget command completed successfully"
|
./discord.sh "$(hostname) forget command completed successfully"
|
||||||
else
|
else
|
||||||
@@ -132,7 +134,7 @@
|
|||||||
echo "Checking backups..."
|
echo "Checking backups..."
|
||||||
# Add your Restic check command here
|
# Add your Restic check command here
|
||||||
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) check --read-data
|
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) check --read-data
|
||||||
if [ $? -eq 0 ] || [ $? -eq 3 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# If the exit status is 0 (success), send a success message
|
# If the exit status is 0 (success), send a success message
|
||||||
./discord.sh "$(hostname) Restic Verification complete"
|
./discord.sh "$(hostname) Restic Verification complete"
|
||||||
else
|
else
|
||||||
@@ -151,7 +153,7 @@
|
|||||||
tr -dc A-Za-z0-9 </dev/urandom | head -c 25 > ./.resticpassword
|
tr -dc A-Za-z0-9 </dev/urandom | head -c 25 > ./.resticpassword
|
||||||
fi
|
fi
|
||||||
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) init
|
restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) init
|
||||||
if [ $? -eq 0 ] || [ $? -eq 3 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# If the exit status is 0 (success), send a success message
|
# If the exit status is 0 (success), send a success message
|
||||||
./discord.sh "$(hostname) Restic Init complete for $(hostname)"
|
./discord.sh "$(hostname) Restic Init complete for $(hostname)"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user