I am new to using Crontab to automate some tasks, and was trying to create an empty text file with the date format as the filename in the /app/tmp folder every minute. I am using Ubuntu 22.04 and accessing cron as the root user.
I tried the echo command to create an empty file using the command:
0-59 * * * * /usr/bin/echo '' > /app/tmp/$(date +%Y-%m-%d_%H:%M).txt
I also tried the touch command to do so:
0-59 * * * * /usr/bin/touch /app/tmp/$(date +%Y-%m-%d_%H:%M).txt
Yet the crontab does not create any files.