You are not logged in.
Pages: 1
So, after years of using Linux, I'm ready to setup my first cron job.
After I start the cron daemon ("crond" from "cronie"), are the cron.[daily, hourly, monthly, weekly] folders supposed to run automatically?
It appears that they're not, and that I have to add jobs to the root crontab by using "sudo crontab -e" to run the scripts in each of those directories. I'm very surprised because I can't seem to find any information about it on the Arch Linux wiki cron page. I did find a bit of information on setting it up here, which looks accurate but a bit old.
Thank you.
Offline
Not sure (I'm not using cronie), but check if https://bbs.archlinux.org/viewtopic.php … 47#p993047 still applies i.e. anacron covers the daily, weekly and monthly jobs.
Why do you think the jobs are not run automatically?
Last edited by karol (2011-11-01 22:23:15)
Offline
Thank you, that's very good information.
The reason I don't think it's working is because the script I made isn't being run... I made a "pacman-sync.sh" script like so:
#!/usr/bash
pacman -Sy 1>/dev/null 2>&1It's owned by root with permissions set to 755. I started "/etc/rc.d/crond" manually and can confirm that the "crond" is running. Both "crontab -l" and "sudo crontab -l" have no output.
I assumed that the script would automatically run every hour, just by being in that directory, but it doesn't appear to be. I still have to type the command by hand to sync pacman.
When I started looking into using cron, I found out I had dcron. I read that dcron had been replaced by cronie in the default Arch Linux install, so I switched to that. Even so, I assume that shouldn't make much difference...
Offline
Wrt running 'pacman -Sy' in a cronjob, please read http://mailman.archlinux.org/pipermail/ … 14645.html
I think the final version of the script is here: http://mailman.archlinux.org/pipermail/ … 14673.html
I'll install cronie and have a look at how it deals with custom cronjobs.
Edit:
'/usr/bash'? Maybe that's your problem?
Last edited by karol (2011-11-02 00:58:01)
Offline
cron seems to be running OK so I think you need to fix your script and check the log.
I've put
#!/bin/bash
touch /home/karol/itsalivein /etc/crond.hourly and it does run. Same for daily cronjobs.
Offline
'/usr/bash'? Maybe that's your problem?
Ooh, I bet that was my problem. Thank you for testing it. I, too, setup a little script to test my installation, and will find out if it works in about an hour. ![]()
Anyway, thanks to your help, I learned a lot about setting up cron and how it works. When I get the chance, I'll update the (outdated) Arch Linux wiki cron page.
Wrt running 'pacman -Sy' in a cronjob, please read http://mailman.archlinux.org/pipermail/ … 14645.html
I think the final version of the script is here: http://mailman.archlinux.org/pipermail/ … 14673.html
Holy moley, that is some serious pacman-scripting voodoo. That's beautiful! Thanks to that script, I no longer need to use cron or check for updates as root.
I saved a personal copy of that "checkupdates" script, but may I ask what the official plans are for it? Will it be included in a package?
Offline
I saved a personal copy of that "checkupdates" script, but may I ask what the official plans are for it? Will it be included in a package?
I only know what Kyle posted to the ML: http://mailman.archlinux.org/pipermail/ … 14645.html
I feel it would make a good addition to pacman-contrib.
Whether our devs feel the same - I don't know ;P
Offline
I wasn't aware of this but it's true (I just checked it), the default setup prevents scripts with dots in the filename from being executed.
Offline
Pages: 1