Project

General

Profile

Bug #7828

Rsync task do run manually, but not automatically

Added by Luka Jurasin over 5 years ago. Updated almost 3 years ago.

Status:
Closed: User Config Issue
Priority:
Important
Assignee:
Suraj Ravichandran
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Rsync task is set with stuff added in Extra options field in GUI:

--log-file=/skripte/log/rSync/logrsync.log.`date +%d%m%Y%H%M`

So it will generate logfile with date added to filename every time it runs.

Everything runs perfect if I select task from GUI and run it via Run Now button, but when the task run automatically (every 6hrs), task fails with following error sent as email.

Cron <root@AtomicStorage> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" /usr/bin/lockf -s -t 0 -k "/mnt/MasterZFSv2/StorageAFP" /usr/local/bin/rsync -r -t -p --delete-delay --delay-updates --log-file=/skripte/log/rSync/logrsync.log.`date +

Followed by:

Syntax error: EOF in backquote substitution
Syntax error: Error in command substitution

Seems like that I am hitting max character count for cron command or something similar.

History

#1 Updated by Jordan Hubbard over 5 years ago

  • Assignee changed from Xin Li to Suraj Ravichandran

#2 Updated by Suraj Ravichandran over 5 years ago

  • Status changed from Unscreened to Screened

#3 Updated by Suraj Ravichandran over 5 years ago

  • % Done changed from 0 to 90

I have almost solved this....running some mroe tests now.

And its not an issue with the cron command max length its your log's date eval quotes.

#4 Updated by Suraj Ravichandran over 5 years ago

  • Status changed from Screened to Resolved
  • % Done changed from 90 to 100

Edit (spellcheck): Unfortunately my testing revealed that there is no easy and more importantly clean way to do this via the code and you will have to escape these characters yourself in the form field.

So to solve your problem:

Replace
--log-file=/skripte/log/rSync/logrsync.log.`date +%d%m%Y%H%M`

with

--log-file=/skripte/log/rSync/logrsync.log.`date +\%d\%m\%Y\%H\%M

and it will work.

#5 Updated by Luka Jurasin over 5 years ago

That solved the issue, thanks for your time and effort.

All the best

#6 Updated by Dru Lavigne almost 3 years ago

  • Status changed from Resolved to Closed: User Config Issue
  • Target version set to N/A
  • Seen in changed from to Unspecified

Also available in: Atom PDF