Hi Boris,
I added a custom job to crontab that builds and uploads a clientraw.txt rapid fire update to my web server every 10 seconds. Do your minor rev updates ever overwrite crontab such that I would have to re-enter the job command?
Thanks.
Jim
Custom crontab: overwrite with updates?
Moderator: Mattk
Re: Custom crontab: overwrite with updates?
may be. If you alter crontab you are on your own.
Re: Custom crontab: overwrite with updates?
Is it better putting a script in /etc/boot for the real time rapid fire updates?
I also run a cron job for weekly backups. Any advantage to use /etc/cron.* rather than crontab?
Thanks.
I also run a cron job for weekly backups. Any advantage to use /etc/cron.* rather than crontab?
Thanks.
Re: Custom crontab: overwrite with updates?
I restored the crontab to your default installation config.
The custom jobs in /etc/cron.d, including rapid fire to my web site, seem to function just fine.
Boris, I would like to know how the cron.d jobs will survive an update. Thanks.
The custom jobs in /etc/cron.d, including rapid fire to my web site, seem to function just fine.
Boris, I would like to know how the cron.d jobs will survive an update. Thanks.
Re: Custom crontab: overwrite with updates?
OK, plowed through a bunch of older updates. The crontab in /etc/cron.d survives. Hope this will persist.
- meteo-quimper
- Junior Boarder
- Posts: 20
- Joined: Thu Jun 07, 2012 1:13 pm
- Location: Quimper - FRance
- Contact:
Re: Custom crontab: overwrite with updates?
Can you share your clientraw rapidfire script ?
Re: Custom crontab: overwrite with updates?
No doubt there are better ways to do this. However, this works perfect for me for rapid fire upload to my web page, and automated backups.
Here is the cron job:
And gensend.sh script to generate the clientraw.txt file:
And backup script:
Here is the cron job:
Code: Select all
## Start section by James McAfee
# rapid fire upload of clientraw; each cycle takes about 10 seconds
* * * * * root /data/scripts/gensend.sh; sleep 8; /data/scripts/gensend.sh; sleep 8; /data/scripts/gensend.sh; sleep 8; /data/scripts/gensend.sh; sleep 8; /data/scripts/gensend.sh; sleep 8; /data/scripts/gensend.sh
#
## Runs backup jobs
# weekly
30 0 * * 6 root /data/scripts/backup_upload.sh weekly -DD
# monthly
0 1 1 * * root /data/scripts/backup_upload.sh monthly
# every 6 months
30 1 1 */6 * root /data/scripts/backup_upload.sh 6month -DD
# yearly
0 2 1 1 * root /data/scripts/backup_upload.sh yearly -DD
## End section by James McAfee
Code: Select all
#! /bin/sh
ULDIR=**** #put your upload dir here; since I run several MH clients I use this var as part of the common script
# Generate clientraw.txt
#
/srv/www/meteohtml.cgi /home/meteohub/clientraw.conf >/var/run/meteohub/clientraw.out
if [ $1 == '-w' ]; then cp /var/run/meteohub/clientraw.out /data/myweb/uploads/clientraw.txt; fi #cp only once/min to minimize flash wear
cp /var/run/meteohub/clientraw.out /var/run/meteohub/perm/clientraw.txt
mv /var/run/meteohub/clientraw.out "/var/run/meteohub/uploads/clientraw.txt"
# Upload files
#
[ -z "`ls /var/run/meteohub/uploads/`" ] || [ -n "`/bin/pidof /usr/bin/ncftpput`" ] || /usr/bin/ncftpput -f /data/scripts/login.conf -S .tmp -R -DD /$ULDIR /var/run/meteohub/uploads/* 2>&1 | /usr/bin/logger
Code: Select all
#! /bin/sh
BUNAME=$1.tar.gz
BUDIR=*** #put your backup dir here
LOGIN=/data/scripts/login.conf #login credentials are in this file
DELLOCALFILE=$2
cd /
tar czpf /data/transfer/meteohub.$BUNAME /data/weather/20* /data/export/dashboard.swf /data/export/dashboard.html /data/graphs /data/scripts etc/rsyncd.conf var/cron/tabs/root home/meteohub/esmtprc home/meteohub/meteohub.conf home/meteohub/logger.conf home/meteohub/wmr928eval.conf home/meteohub/wswin.conf home/meteohub/wd.conf 2>/dev/null
/usr/bin/ncftpput -f $LOGIN -S .tmp -V $DELLOCALFILE -m /$BUDIR /data/transfer/meteohub.$BUNAME 2>&1 | /usr/bin/logger
Last edited by jmcafee on Thu May 01, 2014 2:51 pm, edited 1 time in total.
- meteo-quimper
- Junior Boarder
- Posts: 20
- Joined: Thu Jun 07, 2012 1:13 pm
- Location: Quimper - FRance
- Contact:
Re: Custom crontab: overwrite with updates?
did you have more detail for the installation of the scripts ?
Re: Custom crontab: overwrite with updates?
If you have knowledge of Linux, you should now how this all works. If you are not familiar, I suggest that you not attempt it. Boris will kill you (and maybe me) if you mess up his program.meteo-quimper wrote:did you have more detail for the installation of the scripts ?