[gull] Truc et astuces: crontab -e non interactif
Pierre Maitre
po.maitre at gmail.com
Sun Aug 8 12:56:19 CEST 2010
Le 6 août 2010 13:28, Félix Hauri <felix at f-hauri.ch> a écrit :
> Cela faisait longtemps...
... il était temps!
C'est quoi le 1a (après echo)?
Pierre
> Voici un petit truc qui consiste à utiliser sed pour modifier le crontab
> de manière non interactive.
> (Comme d'hab, basé sur une distrib debian, avec BASH comme shell par défaut)
>
> $ crontab -l
> no crontab for guest
>
> $ echo "1a* * * * * $HOME/script" |
> env EDITOR='sh -c "sleep 1;sed -f - -i \$@" --' crontab -e
More information about the gull
mailing list