I have the following command in my crontab to copy a file named 'data' into an existing directory named 'Archive', with a date stamp appended to it. When I run it on the command line manually, it works fine.
01 0 * * * cp /home/data /home/Archive/data.$(date +%F)
But when cron runs the above (under the same user), the file does not copy, and I get the following error:
cp: 0653-437 2018 is not a directory
date
is installed, and what's your locale? – JigglyNaga Nov 13 '18 at 14:36date +%F
and tell us what you get. it seems that you get a space character somewhere and thecp
command thinks that you're trying to copy several files into a directory. – John Smith Nov 13 '18 at 14:54