I want to list files at 12h01. How can I set my crontab to do this?
pedro@Pedro-PC:~/PL/trab4$ crontab -l
# 01 12 * * * ls -l
|
I want to list files at 12h01. How can I set my crontab to do this?
| |||||||
feedback
|
|
Try putting the
command into a small bash script .... name the file The put make listfiles executable with
then change your crontab to
| |||
feedback
|
|
You can also (which I prefer for smaller commands) do what you did at first, but with the full path to the ls binary. Crontab runs with a smaller $PATH than you do, which is why we give the full path to ls. ie:
You can get the path to your binary with
| |||||||
feedback
|
|
As I stated in your other question, errors and warnings from And your cronjob is wrong, it should be something like: 01 12 * * * ls -l [somedir] > [some file with results] [somedir] is the directory you are trying to list. [some file with results] is a path to the file that will store your result. | |||
|
feedback
|