I'm using a script for testing broadband speed and I would like to set up a cronjob for testing every n minutes and output to a file. The command to launch it from a shell console and append to logfile prepending a line with the current date is
tespeed.py -w | sed -e "s/^/$(date +\"%d-%m-%y\ %T\"), /" >>tespeedlog.csv
But if I use this command in a cronjob something doesn't work; the syslog reports:
Sep 25 13:23:01 raspberrypi /USR/SBIN/CRON[6719]: (pi) CMD (/home/pi/tespeed/tespeed.py -w | sed -e "s/^/$(date +')
What shoud I check?
%
characters with backslashes, see yourcrontab(5)
man page for details.