Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


rsync error.. please help :(
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

rsync error.. please help :(

joshuahjoshuah Member
edited November 2012 in General

Hello,

Can anyone help please.. i am using the following script.. but keep getting error message:
/usr/local/sbin/backup-cpanel.sh: line 5: fg: no job control
Unexpected local arg: /backup/current/
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1215) [receiver=3.0.6]
^C

**here is the code:
**

!/bin/bash

/bin/mail -s "Server backup started" "[email protected]"

BACKUPDIR='date %A';

nice rsync root@ip:/backup/cpbackup/daily/ /backup/current --progress --force --ignore-errors --delete-excluded \ --delete --backup --backup-dir=/backup/$BACKUPDIR \ -avs --recursive

/bin/mail -s "Server backup completed" "[email protected]"

Comments

  • @joshuah can't see the problem but the code is mangled so might be missing something...try formatting the script as code and use the comment preview function to check it looks right...

  • Put the source and destinations at the end and see if it helps

    nice rsync --progress --force --ignore-errors --delete-excluded \ --delete --backup --backup-dir=/backup/$BACKUPDIR \ -avs --recursive root@ip:/backup/cpbackup/daily/ /backup/current

    Also, -a has --recursive in it already, --delete-excluded is useless without a list of excluded files.

  • @joshuah said: BACKUPDIR='date %A';

    Setting of BACKUPDIR looks very wrong - should be backquotes (vanilla formatting?) and have a plus sign in front of the percent sign.

    Since I can't get backquotes to show up right, going with another way:

    BACKUPDIR=$(date +%A);

  • $() should ALWAYS be used instead of backticks.
    Also, yes the date is the issue.

  • @William said: $() should ALWAYS be used instead of backticks.

    You're right but uppercasing it gives it more importance than it deserves :)

Sign In or Register to comment.