Koozali.org: home of the SME Server

Rsync error

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Rsync error
« 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?

guest22

Re: Rsync error
« Reply #1 on: December 03, 2015, 02:00:38 AM »
Please file a bug report.

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Re: Rsync error
« Reply #2 on: December 03, 2015, 09:03:11 AM »
Ok RequestedDeletion, I posted it in the bug report. thanks

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Rsync error
« Reply #3 on: December 03, 2015, 10:44:58 AM »
moving to General Discussion, seems more a syntax error that a strictly SME related issue

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Re: Rsync error
« Reply #4 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

Offline ReetP

  • *
  • 3,940
  • +6/-0
Re: Rsync error
« Reply #5 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'
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Re: Rsync error
« Reply #6 on: December 03, 2015, 11:02:15 AM »
Thanks very much ReetP. I will refer this link.

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Re: Rsync error
« Reply #7 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?

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Rsync error
« Reply #8 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 :-)

Offline smnirosh

  • *****
  • 329
  • +0/-0
  • Learning never ends
Re: Rsync error
« Reply #9 on: December 03, 2015, 01:56:57 PM »
is there any default location where sme server saves rsync log?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Rsync error
« Reply #10 on: December 03, 2015, 04:41:40 PM »
is there any default location where sme server saves rsync log?

No.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Rsync error
« Reply #11 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.