lundi 6 juillet 2009

unix : utiliser la crontab

Les commandes :
export EDITOR=vi ;to specify a editor to open crontab file.
crontab -e Edit your crontab file, or create one if it doesn't already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)

Voici un exemple d'execution d'une tache tous les jours à 18h30 ...
30 18 * * * rm /home/someuser/tmp/*


avec un fichier de log ...
30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log

Tout est là ...
http://www.adminschoice.com/docs/crontab.htm

Aucun commentaire:

Enregistrer un commentaire