I'm currently on Linux Ubuntu 14.04 (I think).
So I previously had a cron.daily script which was working fine. I decided to use the same script but move it to cron.hourly and now it wont work.
/etc/cron.hourly/dstealth-watch-tv
#!/bin/bash
times=$(date)
echo "${times}:" >> /var/log/dstealth/watch-tv.log
/usr/bin/curl --silent http://watch.dstealth.com/tv/refreshToken.php?k=secretRefreshKey >> /var/log/dstealth/watch-tv.log
I've given the file CHMOD: 755
The log file was created manually with CHMOD: 644 and is empty.
Then I used:
service cron reload
and waited several hours hoping for an output into my log file but it remains empty.
I've tried
run-parts --verbose /etc/cron.hourly
and this is the output I get:
/etc/cron.hourly/dstealth-watch-tv:
run-parts: failed to exec /etc/cron.hourly/dstealth-watch-tv: No such file or directory
run-parts: /etc/cron.hourly/dstealth-watch-tv exited with return code 1
This also did not result in anything being input into the log file. I'm not sure where I've gone wrong. Please assist.
Thanks to guidance from JWW, I posted on Unix & Linux Stack Exchange and someone was able to answer the question almost immediately.
The script was created essentially in Windows using NppFTP so the following command was required:
dos2unix /etc/cron.hourly/dstealth-watch-tv
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.