1

I'm having trouble with automation of rdiff-backup. There are 2 issues right now.

Script itself:

#!/bin/bash
​# This is backup script for rdiff-backup

# Backup command
​rdiff-backup --include-globbing-filelist /home/administrator/backup.list / /mnt/backup/dst

#Checking rdiff-backup command success / error
status=$?
if [ $status != 0 ]; then
        # Append error message in ~/backup.log file
        echo "rdiff-backup exit Code: $status - Command Unsuccessful">>~/varundus.log;
        exit 1;
fi
# Remove incremental backup files older than two weeks
​rdiff-backup --force --remove-older-than 1W /mnt/backup/dst/

The first problem, is that the terminal is giving an error when executing:

rdiff-backup --force --include-globbing-filelist backup.list / /mnt/backup/dst/

Error:

Found interrupted initial backup. Removing...
Fatal Error: Last selection expression:
Command-line include glob: /var/www
only specifies that files be included.  Because the default is to
include all files, the expression is redundant.  Exiting because this
probably isn't what you meant.

What's causing that?

The second error, is that if i run my script, i get:

./inc-backup.sh: line 5: ​rdiff-backup: command not found
./inc-backup.sh: line 9: syntax error near unexpected token `then'
./inc-backup.sh: line 9: `​if [ $status != 0 ]; then'

How come, that shell can't find the command, but if i enter it manually it works (with errors of first section). Can somebody please explain what im doing wrong? Thanks :)

zidrun
  • 11
  • 1

0 Answers0