Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cronie not executing cronjobs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Techbart
n00b
n00b


Joined: 24 Jun 2014
Posts: 23
Location: Sweden

PostPosted: Sun Jul 13, 2014 1:48 pm    Post subject: Cronie not executing cronjobs Reply with quote

'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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Jul 13, 2014 2:08 pm    Post subject: Re: Cronie not executing cronjobs Reply with quote

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
View user's profile Send private message
Techbart
n00b
n00b


Joined: 24 Jun 2014
Posts: 23
Location: Sweden

PostPosted: Sun Jul 13, 2014 5:38 pm    Post subject: Reply with quote

D'oh! *bangs head* And there was the reeeaaally obvious thing I was missing :P. 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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3129

PostPosted: Sun Jul 13, 2014 7:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Jul 13, 2014 7:57 pm    Post subject: Reply with quote

szatox ...

you should probably start your own thread as this is an entirely unrelated question.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum