Re: how to use crontab and cron.daily

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 08 July 2006 01:50, Mikkel L. Ellertson wrote:
> nigel henry wrote:
> > On Friday 07 July 2006 22:43, Todd Zullinger wrote:
> > Use crontab -e to edit your crontab.  This will open your editor
> > (specified by the $VISUAL or $EDITOR variables) where you can
> > create/edit as you like.  When you exit, your crontab will be
> > installed.  User crontabs are stored in /var/spoool/cron/$USER, IIRC.
> >
> >> Right. OK. Thanks to you Todd, and to Mikkel. I don't expect anyone to
> >> hold my hand through this, but crontab -e brings up a blank page with
> >> some short line markers on the left side, and "/tmp/crontab.3449" OL, OC
> >> at the bottom of the page. How do I find out which editor this is using?
> >> I've used nano a bit, but not vi, or emacs. I've been through man 5
> >> crontab a few times, but it only shows you the layout for setting up
> >> crontab.
> >>
> >> A couple of hints would be usefull.
>
> If you have not changed things, you are using a version of vi. You
> can check that by running "echo $EDITOR" and "echo $VISUAL". If
> nether command returns anything, then you have not set the editor to
> use, so it defaults to vi. If you want to use Nano, then try running
> "export EDITOR=nano" before running "crontab -e". For the format you
> need in the file, try "man 5 crontab" and see if that helps..
>
> Mikkel
> --
>
>   Do not meddle in the affairs of dragons,
> for thou art crunchy and taste good with Ketchup!

Hi Mikkel, and all the other folks that offered help.

I ran export EDITOR=nano , and sure enough after a crontab -e I got nano. I 
thought the default was probably vi, because hitting the I key got me an 
INSERT at the bottom of the Konsole. Then setup crontab for an alarm, as per 
the example a few posts back, which created a file in /var/spool/cron/$USER.

Next created a very simple script using aplay to play a .wav at the given 
time. 
#!/bin/sh
aplay -Dhw:0,0 <filename>  (and named it alarm)

Moved it to /usr/local/bin using , mv alarm /usr/local/bin  (as root)

Next su'ed to root, and with Gedit, went to /var/spool/cron/$USER, and changed 
the time for this crontab to be run, like 2 mins later to test it, and 
ignoring the "DO NOT EDIT THIS FILE".

Less than 2 mins later the .wav played like magic.

Thanks to all for the help. Its easy when you know how, and is nice to know 
that there are so many folks willing to help.

One last ? Which file did I edit when I ran export EDITOR=nano. I've looked 
around the filesystem but can't find it.

Nigel.



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux