English
Ask Your Question
0

[RESOLVED] Yet another anacron question

asked 2017-11-13 17:04:56 +0000

Paolo gravatar image

updated 2017-11-15 16:12:29 +0000

Hi to all, I'm trying to run anacron to execute some backup script with no results. Please excuse me for another question about this argument. It seems that on my machine anacron isn't running at all. Here my anacrontab

[root@fedora-dell ~]# cat /etc/anacrontab 
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=15
# the jobs will be started during the following hours only
START_HOURS_RANGE=1-23

#period in days   delay in minutes   job-identifier   command
1   5   cron.daily      nice run-parts /etc/cron.daily
7   25  cron.weekly     nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly        nice run-parts /etc/cron.monthly
@daily  15      touch.daily             nice touch /home/idocumenti/$(date +%Y%m%d).file

I think there is no mistake since the anacron -T command doesn't give any output. Some informations about anacron

[paolo@fedora-dell ~]$ journalctl /usr/sbin/anacron | tail
nov 11 19:43:13 fedora-dell anacron[5135]: Will run job `cron.weekly'
nov 11 19:43:13 fedora-dell anacron[5135]: Will run job `cron.monthly'
nov 11 19:43:13 fedora-dell anacron[5135]: Jobs will be executed sequentially
nov 11 19:43:13 fedora-dell anacron[5135]: Job `cron.daily' started
nov 11 19:44:49 fedora-dell anacron[5135]: Job `cron.daily' terminated (mailing output)
nov 11 19:44:49 fedora-dell anacron[5135]: Job `touch.daily' started
nov 11 19:44:49 fedora-dell anacron[5135]: Job `touch.daily' terminated
nov 11 19:44:49 fedora-dell anacron[5135]: Job `cron.weekly' started
nov 11 19:44:49 fedora-dell anacron[5135]: Job `cron.weekly' terminated
nov 11 19:44:49 fedora-dell anacron[5135]: Job `cron.monthly' started

On nov 11 I ran anacron manually. Since then It didn't start. Maybe is related to cron service since both my root crontab and /etc/crontab are empty.

 [root@fedora-dell ~]# crontab -l
 no crontab for root

 [root@fedora-dell ~]# cat /etc/crontab 
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

Any advice is welcome. Please tell me if you need more information. Thanks. Paolo

UPDATE 1 - 20171114 As suggested by villykruse I report here the content of /etc/cron.d/:

[paolo@fedora-dell ~]$ ls /etc/cron.d/
0hourly  raid-check

UPDATE 2 - 20171115 I had two different calls to anacron running at the same time. The firs one was made with a personal crontab. The second one using /etc/anacrontab. I removed the personal one. All seems to work fine now. I thought I could use that way but there should be problems I don't actually know. I ... (more)

edit retag flag offensive close merge delete

Comments

In addition to /etc/crontab also look at the files in /etc/cron.d

villykruse ( 2017-11-13 19:29:34 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-14 16:38:21 +0000

genodeftest gravatar image

I don't know anacron, but you might want to use a systemd.timer (man systemd.timer) instead.

edit flag offensive delete link more

Comments

Never heard about this. I'll give it a try.

Paolo ( 2017-11-15 12:16:41 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2017-11-13 17:04:56 +0000

Seen: 39 times

Last updated: Nov 15