cialis commande levitra costi viagra veritable prix viagra au maroc viagra sottobanco trouver du cialis viagra sans ordonnance belgique viagra naturale acheter cialis paris viagra sur paris cialis effet secondaire achat cialis generique vente viagra france viagra generique acheter viagra medicinale acquistare viagra generico italia prezzo viagra originale acquistare levitra viagra chez la femme vente viagra generique vente kamagra generique cialis 20mg viagra pas cher en france offerte viagra kamagra sans ordonnance viagra dosaggio acheter cialis sans ordonnance trouble erection viagra sur ordonnance cialis a vendre cialis temoignage viagra professionnel levitra maroc cialis en belgique acheter viagra sur internet cialis generico online achat viagra sur internet vrai viagra acquista cialis cialis sans ordonnance belgique sildenafil prezzo viagra a basso costo cialis generique danger viagra acheter en ligne erbe viagra generique sildenafil levitra 20 mg prezzo achat viagra forum impotenza sessuale viagra des femmes acheter viagra generique viagra naturale erboristeria viagra female levitra serve ricetta viagra le prix acquisto cialis originale viagra combien ca coute viagra generico forum cialis prix pharmacie cialis 5mg prix viagra milano levitra farmaco achat viagra generique viagra torino viagra in contrassegno levitra pharmacie levitra compresse viagra prezzi viagra vente libre andorre viagra alle erbe levitra prix pharmacie commander viagra achat cialis en pharmacie cialis da banco cialis generique en pharmacie kamagra paris levitra vendita achat cialis effet viagra sur les femmes cialis costo cialis berlin levitra 20mg prix cialis internet achat viagra quebec viagra vente libre en pharmacie achat viagra andorre cialis originale viagra cialis acquisto vendita viagra senza ricetta viagra prix belgique viagra hollande forum generique cialis prezzo viagra 25 mg viagra pfizer achat cialis generico prezzo cialis remboursement secu pilule cialis viagra temoignage cialis generico 10 mg costo cialis farmacia commande viagra generique cialis au maroc vente cialis en france viagra contrassegno viagra generique pas cher cialis generique suisse vente cialis belgique cialis milano acheter cialis en france cialis 5 mg prezzo viagra indien levitra indien vendita libera viagra libera vendita viagra acheter cialis france generique viagra france prix viagra belgique prix cialis 10 viagra reseller vardenafil prezzo levitra medicinale acquisto viagra generico achat kamagra oral jelly kamagra opinioni comprare cialis generico online viagra ou similaire prix viagra france tadalafil generico farmacia cialis meilleur prix forum cialis generique cialis costa acheter viagra femme acheter cialis pas chere kamagra thailande levitra contrassegno costi cialis cialis generique acheter achat cialis sans ordonnance acquisto cialis 20 mg levitra femme viagra pasti acquistare viagra viagra senza prescrizione viagra riddim levitra differenze commande cialis generique viagra acquisto in contrassegno tadalafil 20mg acquista cialis on line kamagra en belgique cialis 2.5mg prix levitra generico online viagra en ligne acheter viagra sans ordonnance cialis acheter en france cialis 10 prix viagra alternativa viagra pour femme forum viagra generique canada viagra commande commander viagra pfizer simili viagra cialis per donne vendita cialis in svizzera tadalafil prix comprare viagra senza ricetta vente cialis levitra ordonnance viagra prix en france viagra super force viagra ci vuole la ricetta cialis prescrizione medica prezzi viagra acheter viagra en espagne generique du cialis cialis en ligne viagra ricetta medica viagra compresse viagra sostituto viagra vente libre acheter viagra forum trouver du viagra prix viagra cialis viagra femminile cialis svizzera pharmacie en ligne vendita cialis originale viagra prescrizione medica cialis en suisse tarif cialis pharmacie vente cialis 20mg viagra pagamento alla consegna cialis prise quotidienne levitra remboursement costo tadalafil viagra generico funziona achat viagra france viagra da 100 cialis pharmacie paris cialis a roma pasteque viagra comprare viagra a roma cialis o simili sildenafil generique tadalafil ricetta kamagra apcalis acquisto cialis in contrassegno cialis farmaco generico vente viagra pharmacie cialis medicinale acheter viagra en pharmacie viagra costo in farmacia femme viagra viagra a vendre prix du cialis andorre viagra levitra originale prezzo generique cialis efficace viagra soft generico viagra france cialis quebec levitra 5 mg prezzo levitra achat viagra le moins cher achat cialis france viagra vendita on line levitra senza ricetta pilule levitra prescrizione cialis generique du viagra cialis alle erbe viagra france ordonnance tadalafil prezzo achat de levitra costo cialis cialis acheter levitra 10 mg generico prix viagra en france viagra 100 mg cialis generico effetti collaterali levitra pas cher sildenafil donne viagra faut il une ordonnance kamagra vente levitra acquisto comprare cialis su internet achat viagra montreal acheter cialis internet viagra prezzo viagra generique levitra en suisse acheter viagra maroc forum viagra pour femme vente de cialis en belgique cialis au meilleur prix cialis generique forum viagra tunisien viagra recensioni forum cialis naturale vendita viagra generico viagra suisse levitra 10 mg prezzo achat viagra luxembourg dosaggio viagra compro viagra online levitra effet secondaire acheter du viagra achat viagra belgique cialis costi prix de viagra viagra quebec cialis contrassegno cialis generico esiste viagra farmaco cialis sur le net viagra libera vendita viagra cialis prezzi viagra da 25 prix viagra pharmacie acquistare viagra online cialis compresse viagra pfizer prix commander du cialis prezzo cialis viagras en pharmacie acheter viagra pharmacie acheter viagra prezzo cialis 10 naturale viagra cialis sito sicuro viagra vente libre belgique viagra au maroc achat viagra suisse viagra medicament cialis compresse 20 mg vendo viagra generico acquisto viagra italia acquisto viagra cialis generic belgique levitra generique cialis generico viagra lyon cialis 20mg pas cher tadalafil generique pilule viagra acheter viagra 20mg cialis en pharmacie sans ordonnance prix cialis 10 mg procurer du cialis acheter viagra pfizer kamagra generico acheter kamagra 100mg viagra naturale senza ricetta viagra sicuro cialis femminile viagra a paris achat viagra pas cher cialis in contrassegno achat cialis en france cialis pas cher prix cialis en pharmacie viagra simili levitra quanto costa viagra euro acheter cialis 20mg cialis senza ricetta svizzera acheter viagra internet levitra acquisto on line vrai viagra en ligne viagra senza ricetta svizzera tadalafil pas cher cialis generico india cialis moins cher en pharmacie acheter du levitra acquistare viagra su internet levitra moins cher cialis naturale funziona forum viagra internet femminile viagra viagra tarif viagra remboursement secu acheter viagra en france levitra costo prix viagra 100mg costo viagra farmacia viagra generico prezzo cialis marche pas benefici viagra cialis acquisto sicuro achat kamagra acheter cialis 5mg

How-to: Figure out if crontab and at is correctly set up

February 20th, 2009

I have gotten alot of different bug reports and problems sent to me when people try to use gnome-schedule, and quite a few of them are actually crontab and atd problems; mostly just them not being there at all. This post tries to give you an idea about how you can figure out what is wrong; or how it is supposed to work. Exactly how to set up crontab and at differs for all distributions and they all have their own tutorials.

If something works; don’t proceed through the rest of the steps – they are meant as suggestions to solutions. And if you have it working they might break it. That means; no guarantees!

Gnome-schedule is a front-end to crontab and atd, and it is those that actually start the tasks. They have both been around since the beginning of time and were made for the command line, and don’t have any graphical interface.

Crontab is responsible for recurring tasks, scheduled for instance for ‘Every minute’ or ‘Every hour’.. but also quite complex expressions like every second minute of every fifth hour every 13th day of the month, but only if its wednesday. Atd schedules one-time tasks like ‘tomorrow‘ or 24th of December.

Crontab

First you need to have crontab installed (there are several; vixie-cron and dcron works well) use your package manager for this. After having installed it you have to tell your system that the cron daemon should be started at system start, check with your distro on how to do this.

To figure out if the crontab daemon is running you can do the following in a terminal:

$ ps aux | grep cron

This should give you a line ending with something similar to:  ‘/usr/sbin/crond’ .  If not; crontab is not running and you should make sure it is set up like your distro told you.

To check if it is installed you can do:

$ crontab -l

If this command is found; crontab is installed. (The output: no crontab for [username] means crontab is installed)

You need to make sure the crontab command has its SETUID bit set; to check do:

$ ls -l `which crontab`

The output should be similar to (the first -rwsr-xr-x letters should be exactly like this):

-rwsr-xr-x 1 root root 10076 2007-11-15 19:21 /usr/bin/crontab

You can fix this by doing (as root):

$ chmod +s `which crontab`

The cron.allow and cron.deny files, According to the Ubuntu wiki your user must either be in /etc/cron.allow (if it exists) or not be in /etc/cron.deny (if it exists). If neither exist only root can use crontab – this is not true for my system, but might be for Ubuntu.

To make a test task manually you can do the following commands:

$ crontab -e

You now get to edit a file, write this line:

* * * * * echo “Does this work?” > ~/test

See this crunchbang tutorial for details on what this does.

.. wait a minute ..

Check if there exists a file in you home directory, test, with the contents “Does this work?”. If it does, crontab is set up correctly. In that case, delete your crontab:

$ crontab -d

At

Install at and set it up, refer to you distributions documentation.

Check if atd is running:

$ ps aux | grep atd

As with crontab; this should give you a line ending with ‘/usr/sbin/atd‘. If not; at is not running, make sure it is installed and refer to your distro for starting the atd service.

To check if at is installed do:

$ at -V

This should give you:

at version 3.1.9
Bug reports to: rmurray@debian.org (Ryan Murray)
Garbled time

If not; at is not installed, refer to your distro for installing it through the package manager.

At should also have the SETUID bit set;

$ ls -l `which at`

This should give (the -rwsr-sr-x part should be exactly like this):
-rwsr-sr-x 1 daemon daemon 37660 2006-05-31 06:40 /usr/bin/at

Add it with (as root):

$ chmod +s `which at`

To try and make a task; do:

$ at 22:00 19.02.2009 # replace the date with something in the very near future

You know get a at prompt:

at> echo “I work” > ~/at_test
at> <Ctrl>+D

To list current jobs try:
$ atq

If a job shows up now it worked.

Wait for the scheduled time to pass and check the contents of at_test in your home dir; if it is there it worked.

Make sure that you are not listed in /etc/at.deny and that if you have something like an /etc/at.allow file, you are listed. Refer to the at man page.

Other resources:

http://en.wikipedia.org/wiki/At_(Unix)
http://en.wikipedia.org/wiki/Cron

Crontab man page – http://www.manpagez.com/man/5/crontab/
At man page – http://linux.die.net/man/1/at

Ubuntu Wiki – https://help.ubuntu.com/community/CronHowto
Crunchbang Tutorial – http://crunchbang.org/archives/2007/10/26/howto-setup-a-crontab-file/

Tags: , , , ,

4 Responses to “How-to: Figure out if crontab and at is correctly set up”

  1. Zaheer Says:

    Ok. Till what you have said here, has been done.

    Now, the question is, if I want to start my torrent client or my music player at a scheduled time, how do I go about it? I typed the program command, but nothing happens, except that when the time comes, it gets removed from the task list..

    I guess I am overlooking something, but I am not able to find out what that is.

    Can you please help me out?

  2. gaute Says:

    You have to use the latest version of gnome-schedule (2.1.0), you can get the source from http://gnome-schedule.sf.net. It is has probably not been packed for your distro yet, so post a bug or request something happens if it already exists.

    Otherwise execute programs like this: export DISPLAY=:0 && command-name

    Check out the ubuntu wiki on this: https://help.ubuntu.com/community/CronHowto

    - gaute

  3. Zaheer Says:

    OMG! It is working! :-)

    That was exactly what I was overlooking… that export display variable.

    Thank you so much, man.

    And keep up the good work! :-)

  4. Smileyguy Says:

    Thanks guys,

    I had the same problem trying to get BitTornado to download at a set time. A similar solution worked for me except the code missing off the front of mine was “env DISPLAY=:0″ (minus the quotes) so the full code reads:

    env DISPLAY=:0 /usr/bin/btdownloadgui.bittornado /home/user/torrents/filename.torrent
    (need to replace “user” with your username and “filename” with correct filename).

    I’m using Ubuntu 9.04

    More explanation of env DISPLAY=:0 can be found here https://help.ubuntu.com/community/CronHowto towards the bottom – although you should read the whole page if you’re new to this (like me).

Leave a Reply

  • Viagra ordre
  • Cialis en ligne
  • Levitra en ligne
  • Propecia acheter
  • Viagra acheter
  • Acheter cialis
  • Ordre levitra
  • Ordre propecia
  • En ligne viagra
  • Vente cialis
  • Levitra bon marche
  • Propecia en ligne
  • Viagra online
  • Buy cialis
  • Order Levitra
  • Buy propecia
  • Buy viagra
  • Cheap cialis
  • Cheap Levitra
  • propecia online
  • Viagra prescription
  • Cialis online
  • Buy Levitra
  • Order propecia