View previous topic :: View next topic |
Author |
Message |
Techbart n00b
Joined: 24 Jun 2014 Posts: 23 Location: Sweden
|
Posted: Sun Jul 13, 2014 1:48 pm Post subject: Cronie not executing cronjobs |
|
|
'ello all. I'm trying to setup a series of cronjobs using cronie to update my apache2 htdocs on a daily basis. However, no matter what approach I try, I so far have not been able to get any cronjobs to execute. I have checked that the service is running, have tried issuing cronjobs using "crontab -e" and/or editing /etc/crontab, and for both of these approaches I've tried issuing the command for a cronjob, and referencing a bash script.
I've only recently started using Gentoo, having previously used Fedora, and whenever I've tried any of the approaches I've mention with anacron, things have worked flawlessly. I just can't help feeling as though I'm missing something reeeeaaally obvious :$. Oh, and the Gentoo install I'm using right now is the latest (as of this June) x64 build, having followed the Handbook. The only other things done besides a base install, are to install apache2, samba, Oracle Java and BIND. An example of one of the cronjobs I'm trying to run is posted below:
45 13 * * * rm -Rf /home/user/Minecraft\ Overviewer/ Rendered\ Maps/*
# Report Overviewer rendered maps replacement
46 13 * * * echo "Wiping Overviewer rendered maps prior to update"
Any help greatly appreciated. Cheers! |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Jul 13, 2014 2:08 pm Post subject: Re: Cronie not executing cronjobs |
|
|
Techbart wrote: | Code: | 45 13 * * * rm -Rf /home/user/Minecraft\ Overviewer/ Rendered\ Maps/* |
|
Techbart ... not sure about the more general issue (it might help to see the entire crontab) but the above will fail as the path has an extranious space.
Code: | # pwd
/home/khayyam/tmp/test
mkdir -p Minecraft\ Overviewer/ Rendered\ Maps/
# ls -l
total 8
drwx------ 2 khayyam users 4096 2014-07-13 15:58 Minecraft\ Overviewer/
drwx------ 2 khayyam users 4096 2014-07-13 15:58 Rendered\ Maps/
# rm -fr {M,R}*
# mkdir -p Minecraft\ Overviewer\ Rendered\ Maps/
# ls -l
total 4
drwx------ 2 khayyam users 4096 2014-07-13 16:00 Minecraft\ Overviewer\ Rendered\ Maps/
# rm -fr Minecraft\ Overviewer\ Rendered\ Maps/* |
Space is a "special character", in the above (non-)path you haven't quoted/protected the space so are really supplying two paths, and the intended target directory is uneffected.
best ... khay |
|
Back to top |
|
|
Techbart n00b
Joined: 24 Jun 2014 Posts: 23 Location: Sweden
|
Posted: Sun Jul 13, 2014 5:38 pm Post subject: |
|
|
D'oh! *bangs head* And there was the reeeaaally obvious thing I was missing . Thanks for pointing that out and snapping me out of staring straight past my typo . It turns out that I was being doubly confused by not receiving a notification when the cronjob was running, as I attempted to initiate with the "echo" command shortly before the rm. Figured that I need to pass it to the tty I'm using in order to see the echo part of the cronjob, but I've tested it now and it's working for the rm part. Thanks again |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3134
|
Posted: Sun Jul 13, 2014 7:25 pm Post subject: |
|
|
need a simple hint too.
How do I make
Quote: | cat /etc/cron.daily/emerge-sync
exec emerge --sync
| report to
Quote: | ls -l /var/spool/cron/lastrun/cron.daily
-rw-r--r-- 1 root root 0 Jul 13 20:30 /var/spool/cron/lastrun/cron.daily
|
I know the job itself works for I see updates every now and then
Code: |
rc-update | grep cron
anacron | default
vixie-cron | default |
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sun Jul 13, 2014 7:57 pm Post subject: |
|
|
szatox ...
you should probably start your own thread as this is an entirely unrelated question.
best ... khay |
|
Back to top |
|
|
|