Anacron job is not executed

wimduk

New Member
Joined
Mar 24, 2021
Messages
2
Reaction score
1
Credits
56
Dear reader,
I try to setup a personal anacron environment to execute scrips on a regular basis, until now I am not successfull to get it up and working working.
I have read and tried tons of documents without success. My last basis of the personal anacron setup is this document :

My computer
Linux wim-pc 4.19.0-14-686 #1 SMP Debian 4.19.171-2 (2021-01-30) i686 GNU/Linux
wim-pc
description: All In One
product: MS-B06211
vendor: MICRO-STAR INTERNATIONAL CO., LTD
width: 32 bits
capabilities: smbios-2.7 dmi-2.7 smp-1.4 smp
configuration: boot=normal chassis=all-in-one cpus=2 uuid=F3DA866B-F888-B209-5F15-448A5B3B6738
*-core
description: Motherboard
product: MS-B0621
vendor: MICRO-STAR INTERNATIONAL CO., LTD
physical id:
version: 100
*-firmware
description: BIOS
vendor: American Megatrends Inc.
*-memory
description: System Memory
physical id: 40
slot: System board or motherboard
size: 4GiB
*-cpu:0
description: CPU
product: Intel(R) Celeron(R) CPU 1037U @ 1.80GHz
vendor: Intel Corp.
---------------------------------------------------------------

My anacron environment
I have the following directories files
/home/wim/.anacron anacrontab
/home/wim/.anacron/timestamps empty
/home/wim/.anacron/user.daily 0anacron, copyfin
/home/wim/.anacron/user.montly empty
/home/wim/.anacron/user.weekly empty

Anacron testing and starting
I have setup my anacron environment with the following commands
1. /usr/sbin/anacron -fn -t /home/wim/.anacron/anacrontab \ -S /home/wim/.anacron/timestamps # setup personal anacron environment, no warnings.
2. /usr/sbin/anacron -T -t /home/wim/.anacron/anacrontab \ -S /home/wim/.anacron/timestamps # test personal anacron environment, no warnings.
3. /usr/sbin/anacron -s -t /home/wim/.anacron/anacrontab -S /home/wim/.anacron/timestamps # activate personal anacron environment, no warnings.

Be aware :I had to add "/usr/sbin/" in front of the command, otherwise "anacron" was not found.

Troubleshoot
Upfront : I have set with "chmod 777" all directories and scripts to full access for all users and groups.
1. I ran the copyfin script by hand /home/wim/.anacron/user.daily/copyfin and the output was as expected; the file "copy_financieel.txt" was created.
So my first conclusion is that the script is Oke
2. To narrow the problem area I copied the copyfin script to the "/etc/cron.daily" directory and restarted the machine, but NOTHING happened.
I waited long after the aptitude script was executed before looking for the output of the copyfin script.

So at the moment I am lost and would like to ask the SparkyLinux community for help!
With many thanks in advance for everyone who is looking after ma problem

Kind regards, wimduk
[REDACTED]

Scripts
-------------------------------------------------------------------
anacrontab
# See anacron(8), anacrontab(5) and run-parts(8) for details.
# Users anacrontab
#
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=wim
#
# Personal entries for user wim
1 5 cron.personal run-parts -v /home/wim/.anacron/user.daily
#
# eof
-------------------------------------------------------------------
0anacron
#!/bin/sh
#
# anacron's cron script
#
# This script updates anacron time stamps. It is called through run-parts
# either by anacron itself or by cron.
#
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.

test -x /usr/sbin/anacron || exit 0
/usr/sbin/anacron -S /home/wim/.anacron/timestamps -u -t /home/wim/.anacron/anacrontab user.daily
-------------------------------------------------------------------
copyfin
#!/bin/bash
# Copy_Infobase_Financieel to /home/wim/Dropbox
#
#Local: rsync [OPTION...] SRC... [DEST]
#options
# -v, --verbose increase verbosity
# -u, --update skip files that are newer on the receiver
# -r, --recursive recurse into directories
# -b, --backup make backups (see --suffix & --backup-dir)
#
# ---------------------------------------------------------
# Variabelen
PATH=/sbin:/bin:/usr/sbin:/usr/bin
Bron=/media/wim/Data/00_Infobase_Data/00_Financieel/
Doel=/home/wim/Dropbox/00_Financieel/
Rapport=/home/wim/Cron_Rapporten
echo $Bron
echo $Doel
#
# ---------------------------------------------------------
#
echo # --------------------------------------------------------- >> $Rapport/copy_financieel.txt
rsync -urv $Bron $Doel >> $Rapport/copy_financieel.txt
#
# ---------------------------------------------------------

Questions
Q1 why is the lshw command not available in the SparkyLinux /bin directory?
 
Last edited by a moderator:


Gday wimduk and welcome to Linux.org

please remove your email address.....it is a known target for spammers etc etc
 
@Condobloke, thanks for the notification.

@wimduk I edited your post to remove your email address. Please avoid posting your email address in the future. It's a forum, not a mailing list.
 
G'day @wimduk and welcome to linux.org :)

I'm moving this Thread to Command Line where such inquiries are better answered.

Hold onto your hats and take a magic carpet ride with the Wiz.

@Condobloke and @KGIII note the change in venue

Chris Turner
wizardfromoz
 

Members online


Top