unable to make anacron work

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
roy pittman
Level 1
Level 1
Posts: 33
Joined: Sat Jun 10, 2017 2:13 pm

unable to make anacron work

Post by roy pittman »

I am using linux mint here at home.
I am trying to automate an update on line at freethinkerslivingsober.org which is hosted by gandi.net.

gandi.net does provide a variant of anacron that is not completely standard.
This is taken from an email from gandi to myself:
More information available at this page of our documentation :
https://doc.gandi.net/en/simple/anacron[/url]

Here is the data I have gathered, which I have also sent to gandi:

===================my anacrontab=====================
hosting-user@roypittman:/srv/data/etc/cron$ cat anacrontab
# num@period delay(unused) name script...
#
#
1@daily 0 update_index /bin/sh /srv/data/home/anacron_script_1.sh
hosting-user@roypittman:/srv/data/etc/cron$


========================my shell script to update my index.html===================
hosting-user@roypittman:/srv/data/home$ ls
anacron_script_1.sh
hosting-user@roypittman:/srv/data/home$ vi anacron_script_1.sh
1 #!/bin/sh
2 # find the day of the year and insert same into index.html. to be done daily.
3
4 # get the current date
5 # using variables instead of files
6 old=`sed -n '30p' /srv/data/web/vhosts/freethinkerslivingsober.org/index.html|cut --characters=11-14`
7 # echo old date is $old
8 new=`date --iso-8601|cut --delimiter=- --fields=2-|sed 's/-//'`
9 # echo new date is $new
10 # the line in /srv/data/web/vhosts/freethinkerslivingsober.org/index.html to be re-written is line 30
11 #<a href="0518.html">The Daily Reading</a><br>
12 sed "30 s/$old/$new/" </srv/data/web/vhosts/freethinkerslivingsober.org/index.html>newindex.html # doublequotes for variable expansion!
13 # re-arrange files
14 mv newindex.html /srv/data/web/vhosts/freethinkerslivingsober.org/index.html
15 exit 0
:q
=======shows where anacrontab & anacron_script_1.sh & index.html are located======
hosting-user@roypittman:/srv/data/home$ ls
anacron_script_1.sh

hosting-user@roypittman:/srv/data/web/vhosts/freethinkerslivingsober.org/htdocs$ ls|grep index
index.html
smallindex.html
hosting-user@roypittman:/srv/data/web/vhosts/freethinkerslivingsober.org/htdocs$ cd /srv/data/etc/cron
hosting-user@roypittman:/srv/data/etc/cron$ ls
anacrontab
hosting-user@roypittman:/srv/data/etc/cron$ cat anacrontab
# num@period delay(unused) name script...
#
#
1@daily 0 update_index /bin/sh /srv/data/home/anacron_script_1.sh
hosting-user@roypittman:/srv/data/etc/cron$ Connection to console.sd6.gpaas.net closed.

=====================log file after my anacron attempt failed===============
hosting-user@roypittman:/srv/data/var/log/cron$ cat user.log
sed: can't read index.html: No such file or directory
/srv/data/home/anacron_script_1.sh: 12: /srv/data/home/anacron_script_1.sh: cannot open index.html: No such file
mv: cannot stat 'newindex.html': No such file or directory
sed: can't read /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file or directory
/srv/data/home/anacron_script_1.sh: 12: /srv/data/home/anacron_script_1.sh: cannot open /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file
mv: cannot stat 'newindex.html': No such file or directory
sed: can't read /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file or directory
/srv/data/home/anacron_script_1.sh: 12: /srv/data/home/anacron_script_1.sh: cannot open /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file
mv: cannot stat 'newindex.html': No such file or directory
sed: can't read /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file or directory
/srv/data/home/anacron_script_1.sh: 12: /srv/data/home/anacron_script_1.sh: cannot open /srv/data/web/vhosts/freethinkerslivingsober.org/index.html: No such file
mv: cannot stat 'newindex.html': No such file or directory
hosting-user@roypittman:/srv/data/var/log/cron$ date
Mon May 28 14:53:53 UTC 2018 # Paris FR time
hosting-user@roypittman:/srv/data/var/log/cron$

Post Reply

Return to “Software & Applications”