Try redirecting the output to a file like this :
* * * * * /home/myfile.sh > output_file.txt
and you will see it is working.
Cron jobs don't output to the same terminal you are using.
Edit
If you are using crontab -e
for scheduling jobs, you are using a user's specific crontab. Thus, you can only write to that user's home directory (or other directories he has access to). So if you modify you cron job to:
* * * * * /home/myfile.sh > /home/<username>/output_file.txt
You will see that the output was written to that file under the user's home directory.
If you want to write to other directories, I suggest you use the system-wide crontab in /etc/crontab
By the way, you might want to enable logging for cron jobs in order to track problems. You need to edit the /etc/rsyslog.conf or /etc/rsyslog.d/50-default.conf
file and make sure you have the following line uncommented or add it if it is missing:
cron.* /var/log/cron.log
Then restart rsyslog
and cron
:
sudo service rsyslog restart
sudo service cron restart
Now you see if your command was run by cron or not.