0

I have the below cron command which is working perfectly with CPanel, but not working in the DirectAdmin panel. This command downloads a zip file every minute having the current date as a name (ex. 2021-03-09.zip) from the remote URL to the local directory. I have attached an email to receive cron output. The output is written below the command. I am using shared hosting with an apache server and PHP.

Command:

* * * * * /usr/bin/wget -U "anyuser" http://example.com/directory/`date +%Y-%m-%d`.zip -O /home/username/public_html/directory/`date +%Y-%m-%d`.zip

Error:

/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
jwvh
  • 50,871
  • 7
  • 38
  • 64

1 Answers1

0

Finally after trying many thing I have found working answer. I just need to escape % sign and the cron started working perfectly. Escaped all % sign with backslash and directadmin control panel started recognizing it. Thank You.

* * * * * /usr/bin/wget -U "anyuser" http://example.com/directory/`date +\%Y-\%m-\%d`.zip -O /home/username/public_html/directory/`date +\%Y-\%m-\%d`.zip