• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Redirect crontab notification to log-file with date in filename

SteffenM

New Pleskian
Hi,
I know may threads are about redirecting the crontab notifications but I haven't found any thread telling how to redirect the output in a file with the date in the filename.
I also know theoretically how to do that, but it doesn't work, so I ask the question here.
What I have tried yet is the following:

/path/to/script/scipt.pl > /var/log/cron/plesk-cron-script_$(date +%y%m%d).log 2>&1

/path/to/script/scipt.pl > /var/log/cron/plesk-cron-script_`date +%Y-%m-%d`.log 2>&1

I have to admit that I'm not sure what exactly the difference is between the two versions. I have read somewhere that it is recommended to use the first version.

When I try the lines above in the linux-shell they work both as I want them to work. But the error-mails from the cron tell something like this:
For the first version:
"/bin/sh: -c: line 0: unexpected EOF while looking for matching `)'
/bin/sh: -c: line 1: syntax error: unexpected end of file"

For the second version:
"/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file"

Can anyone tell me what's my fault?

Greets,
Steffen
 
Back
Top