Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: smnirosh on December 02, 2015, 10:50:55 PM

Title: Rsync error
Post by: smnirosh on December 02, 2015, 10:50:55 PM
rsync -avr --delete  --log-file="/var/log/rsync/rsync.log.$(date +%Y%m%d%H%m%S)" /home /mnt/backnas

I used above command in crontab to backup home directory to nas drive. thanks for contribs.org people told me how to see admin logs via webmail, it logs everything.
In the log I see following error after i added --log-file="/var/log/rsync/rsync.log.$(date +%Y%m%d%H%m%S)" to the above syntax in the crontab.
/bin/sh: -c: line 0: unexpected EOF while looking for matching `)'
/bin/sh: -c: line 1: syntax error: unexpected end of file


But I manually run this command, it works fine. but with crontab it makes an error code and stops with no rsync.log file created.

how solve this problem?
Title: Re: Rsync error
Post by: guest22 on December 03, 2015, 02:00:38 AM
Please file a bug report.
Title: Re: Rsync error
Post by: smnirosh on December 03, 2015, 09:03:11 AM
Ok RequestedDeletion, I posted it in the bug report. thanks
Title: Re: Rsync error
Post by: Stefano on December 03, 2015, 10:44:58 AM
moving to General Discussion, seems more a syntax error that a strictly SME related issue
Title: Re: Rsync error
Post by: smnirosh on December 03, 2015, 10:49:01 AM
Danial B. is suggesting to add user account to run this command. Do i have to put admin username of server or username of NAS drive? show me a little example. thanks
Title: Re: Rsync error
Post by: ReetP on December 03, 2015, 10:52:12 AM
Danial B. is suggesting to add user account to run this command. Do i have to put admin username of server or username of NAS drive? show me a little example. thanks

Smirno,

You MUST go and read some documentation and educate yourself a bit more.

Search engines are very good. Just do 'man crontab' and you will lots of help. They even translate pages for you.....

e.g. http://linux.die.net/man/5/crontab

For the record here I think the format you are looking at is something like :

00 20 * * 1-5 root rsync -avr --delete

Note the user 'root'
Title: Re: Rsync error
Post by: smnirosh on December 03, 2015, 11:02:15 AM
Thanks very much ReetP. I will refer this link.
Title: Re: Rsync error
Post by: smnirosh on December 03, 2015, 11:22:23 AM
.$(date +%Y%m%d%H%m%S)"

I removed this part of the file then it works. But it append data to the same rsync.log file without creating relavent rsync.log files. is there any mistake with this part of command?
Title: Re: Rsync error
Post by: Stefano on December 03, 2015, 11:25:30 AM
instead of calling rsync from crontab, just create your backup script and then call it from crontab.

easier to do than to explain :-)
Title: Re: Rsync error
Post by: smnirosh on December 03, 2015, 01:56:57 PM
is there any default location where sme server saves rsync log?
Title: Re: Rsync error
Post by: CharlieBrady on December 03, 2015, 04:41:40 PM
is there any default location where sme server saves rsync log?

No.
Title: Re: Rsync error
Post by: CharlieBrady on December 03, 2015, 04:46:21 PM
Please file a bug report.

That wouldn't be appropriate for a custom change.

Stefano's advice is appropriate.