Reputation: 1794
I feel very dumb but why does it not work when I just want to use a simple Linux command in a crontab?
0 0 0 * * ? ls /data/synology/multimedia/movies > /data/storage/backup/movies.txt 2>&1
This ends up in -bash: 0: command not found
. Why is ls not found? What is wrong?
Upvotes: 1
Views: 2085
Reputation: 630
try this one. use absolute path of ls
.
first of all find the absolute path with whereis ls
then add crontab
as below.
0 0 0 * * /bin/ls /data/synology/multimedia/movies > /data/storage/backup/movies.txt 2>&1
Upvotes: 0
Reputation: 321
You are not specifying a command to bash. It thinks 0 is the name of the program you want to run.
Upvotes: 2