[arm-allstar] Adjusting/Turning Off Time Announcement?
Nate Bargmann
n0nb at n0nb.us
Thu Jun 25 21:54:40 EDT 2020
* On 2020 25 Jun 17:07 -0500, "Chris Smart via ARM-allstar" wrote:
> Sorry for asking such a basic question here, but I am not at all a Linux
> person.
>
>
> I'd like to adjust the time announcement on my node, either turn it off or
> adjust how often it occurs.
>
>
> I'm a Windows user.
>
>
> I am used to using something like WinSCP to access my node and edit .conf
> files. I have also typed the odd thing at the command prompt, but I have no
> idea what to do with the instructions I just got from a friend.
>
>
> "You need to comment out the appropriate line in your crontab. crontab -e to
> bring up the crontab in Nano."
>
>
> OK, so I go to the Linux prompt on my node and type:
>
> crontab -e
>
>
> I have no idea what any of what is then displayed means or refers to or what
> to alter.
Hi Chris.
You're staring at this text:
# Do not remove the following line
# required for lsnodes and allmon
15 03 * * * cd /usr/local/sbin; ./astdb.php cron
00 0-23 * * * (source /usr/local/etc/allstar.env ; /usr/bin/nice -19 /usr/bin/p$
In the crontab format the '#' (pound) symbol begins a comment.
Everything from the '#' to the end of the line will be ignored, so you
see the first two lines are comments giving the person editing the
crontab instructions not to remove the next line that is not commented,
the line line that begins with '15'.
The second uncommented line that begins with '00' is the command line of
the script that gives the voice announcements at the top of the hour.
The interval values can be more precisely configured, but here are the basics.
Each interval fields are separated by one or more spaces or tabs.
The first field is the minute of the hour the command should run. In
this case it is the top of the hour--minute 0. The allowed values range from
0-59.
The second field is the hours. Here the range is specified as 0-23 but
could have been a '*' (star) and had the same effect. The allowed
values range from 0-23.
The third field is the day of the month. In this case the value is '*'
which always stands for first-last. The allowed values range from 1-31
(watch this as this field and the next begin with 1, not 0!)
The fourth field is the month. Again this is set to * and the allowed
range is 1-12.
The fifth field is the day of week and it is likewise set to *. This
one is tricky as the range is 0-7. Whoa! Eight days? Well, not quite,
the manual says 0 and 7 stand for Sunday.
Text names may be used for the month and day of week. The manual page
has the details.
The last field is the command to run. It is passed to the shell that
runs the command, spaces and all. As this is the command field, cron
does no further separation by spaces so long as it found the first five
fields.
To end the hourly announcements simply put a # at the beginning of the
line that now starts with 00 and save the file when exiting nano.
> Also, is there any way to edit this in a more familiar editor? Like, you
> know, Notepad in Windows?
No, because you are actually editing a special temporary file cron gives
to nano that when it is saved by nano will be parsed by cron for any
errors and if no errors are found is loaded by the cron daemon process
so the changes take effect immediately.
> Thanks. And again, sorry for such a basic question, but I am out of my depth
> here.
We all started some place. :-)
You can read about the crontab file format with this command:
man 5 crontab
This will start the manual page viewer. You can use Page-Down and
Page-Up or the Up and Down arrow keys to scroll. You can search for
text strings with the '/' command. To exit type 'q' to quit. You can
learn more by typing:
man man
If you're not sure of what the manual page might be you can use the
apropos command:
apropos cron
anacrontab (5) - configuration file for Anacron
anacron (8) - runs commands periodically
cron (8) - daemon to execute scheduled commands
crond (8) - daemon to execute scheduled commands
crontab (1) - maintains crontab files for individual users
crontab (1p) - schedule periodic background work
crontab (5) - files used to schedule the execution of programs
One package I install on all my Linux systems is Midnight Commander. It
is a character User Interface program and makes it much easier to
navigate the file system. It also features an internal file viewer and
editor. I've used it so long that I prefer its editor to nano for
various reasons though nano is quite easy as the '^X' notation means
Control-X, etc.
Midnight Commander can be installed with:
pacman -Sy mc
Have fun!
73, Nate
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
More information about the ARM-allstar
mailing list