Page 1 of 1

crontab: %-sign

Posted: 2018/12/19 07:56:05
by r_a_mueller
Hi all,
I wanted to print a table, generated with a cronjob. The date in this table should be printed as follows:

Code: Select all

19.12.2018 08:40:02
Because the %-sign in the crontab writes a new line, I escaped the % with \ within the date command:

Code: Select all

date +"\%d.\%m.\%Y \%T"
But the backslash will be printed, too, in contrast to all the information I found:

Code: Select all

\19.\12.\2018 \08:40:02
This is not what I want. How can I get rid of the backslash in the output?

Thank you, richard

Re: crontab: %-sign

Posted: 2018/12/19 17:18:33
by r_a_mueller
Everything OK. It was my stupidness. The %'s are inside the script, which is called by cron, and not in the crontab itself. Sorry for this foolish question.

-richard