So I want to save some power and let the raspberry pi download my files instead of my PC which is a power monster
I want to start my downloads at 3am and pause them at 7am. I tried to use crontab but it never works
How can I do this :?
I've written a python script to do this for me but I'm not sure how to always execute it at startup or leave it running because I only use SSH. I'm not sure if it's ok to always have this script running in terms of cpu usage or other safety stuff! (it just executes wget and sends terminate signal if its 3am or 7am, I have a file on desktop which i add my links too thought ssh)
I have archlinux installed on it!
here's my crontab which doesn't work:
0 3 * * * wget -c -i /home/mename/Desktop/downloads.txt
0 7 * * * killall wget
edit:
still doesn't work, i made this job * * * * * echo "WAIT WHAT?" > /home/alarm/Desktop/Iscromwell.list
adding this to SU works (running crontab -e
with sudo) isn't this dangerous :? why doesn't it work as a normal user!?
Edit:
I moved this to Linux section as this is more Linux related now. Things got serious! I have no cron service running and i get an error trying to run it
chmod +x your_script
? With and without sudo? Did you try adding your script to root's crontab as well as your user's crontab viacrontab -e
/sudo crontab -e
? (only add the script to one of the crontabs but test both - one at a time). Add a pid file feature or some other locking mechanism to the script to prevent cron from starting multiple instances – jDo Mar 15 '16 at 13:29echo "WTH IS WRONG WITH YOU CRONTAB" > /home/alarm/Desktop/DownloadedFiles/IHATEYOU.TXT
is my new dummy, its at52 19 * * *
which is 2 minutes from now (7:50 PM) and It didn't work :( – user3033693 Mar 16 '16 at 16:23&>
). Do not includesudo
. Do not even include arguments. You can put all that stuff in a short, simple shell script and your life is much easier. – goldilocks Mar 16 '16 at 16:32echo "hello world" > /tmp/test_this.txt
to work then you should explain all that in detail over at Unix & Linux. By detail I do not mean "I am trying to do this for my project...", "I am using a raspberry pi and...", etc. Just linux will do fine for context with cron. The detail is: 1) The exact text of the script your're trying to execute. 2) The complete output ofstat
run on this script. 3) The entire content, and the exact path, of thecrontab
you put an entry into to execute this script. – goldilocks Mar 16 '16 at 16:32stat
, no idea what it is! – user3033693 Mar 16 '16 at 16:54man stat
and try it --stat myscript.sh
. It won't do anything to it. My reason for that is it is provides evidence of who owns the script and what permissions are on it (there is still a caveat with access if part of the path the script is in is not readable by a user that could otherwise use the script, but never mind that, presuming this is the system's root powered cron). The point of stuff like this is many people (including me, pretty often) will just skip over stuff where it is obvious too much discussion and "we need this information", etc. has to go on... – goldilocks Mar 16 '16 at 17:07