Hello,
I have a backup launched by cron.weekly However, since F40, after it has run a first time and ended, another backup is started. This messed up the backup.
When starting, the first crond sent (ps -aux | grep -i backup | mail -s Backup root@localhost.localdomain) root 19672 0.0 0.0 228476 3136 ? S 12:29 0:00 /bin/sh /etc/cron.weekly/backup.cron root 19673 0.0 0.0 227904 2248 ? S 12:29 0:00 sed 1i\ /etc/cron.weekly/backup.cron:\ root 19683 0.0 0.0 227752 2276 ? S 12:30 0:00 grep -i backup root 19684 0.0 0.0 238028 5352 ? S 12:30 0:00 mail -s Backup root@localhost.localdomain
and at thz end
backup ended at Sat Jun 22 02:55:58 PM CEST 2024 /dev/sda10, /dev/sdb8 and /dev/sdc6 OK and the second one
root 29787 0.0 0.0 228476 3260 ? S 14:55 0:00 /bin/sh /etc/cron.weekly/backup.cron.saved root 29788 0.0 0.0 227904 2176 ? S 14:55 0:00 sed 1i\ /etc/cron.weekly/backup.cron.saved:\ root 29798 0.0 0.0 227752 2208 ? S 14:55 0:00 grep -i backup root 29799 0.0 0.0 238028 5428 ? S 14:55 0:00 mail -s Backup root@localhost.localdomain
Here is the /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 #22 23 * * * root run-parts /etc/cron.daily #30 12 * * 3,6 root run-parts /etc/cron.weekly 30 12 * * 6 root run-parts /etc/cron.weekly # cron.weekly is actually run by anacron #*/12 * * * * /home/root/bin/periodic.sh
and the /etc/anacrontab # 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=35 # the jobs will be started during the following hours only START_HOURS_RANGE=3-22
#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
Is there a conflict between cron and anacron ?
This machine is turned on and off usually on a daily basis, but not necessary.
Thank for your lights
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com ===========================================================================
On Sat, Jun 22, 2024, at 7:17 AM, Patrick Dupre via users wrote:
Hello,
I have a backup launched by cron.weekly However, since F40, after it has run a first time and ended, another backup is started. This messed up the backup.
When starting, the first crond sent (ps -aux | grep -i backup | mail -s Backup root@localhost.localdomain) root 19672 0.0 0.0 228476 3136 ? S 12:29 0:00 /bin/sh /etc/cron.weekly/backup.cron
[snip]
and the second one
root 29787 0.0 0.0 228476 3260 ? S 14:55 0:00 /bin/sh /etc/cron.weekly/backup.cron.saved
If you run:
ls -la /etc/cron.weekly/
I think you will find a "regular" and a ".saved" copy of your cron script.
ls -la /etc/cron.weekly/
drwxr-xr-x. 2 root root 4096 Jun 22 16:14 . drwxr-xr-x. 248 root root 20480 Jun 22 16:04 .. -rwxr-xr-x. 1 root root 1685 Jun 8 16:17 backup3 -rwxr-xr-x. 1 root root 3563 Jun 8 16:36 backup.cron -rwxr-xr-x. 1 root root 3561 Jun 6 22:55 backup.cron.saved
Good, it seems that (during the update?), a backup.cron.saved has been created. I guess that I can just moved to backup.cron_saved
Sent: Saturday, June 22, 2024 at 4:25 PM From: "Doug Herr" fedoraproject.org@wombatz.com To: "Fedora Users" users@lists.fedoraproject.org Cc: "Patrick Dupre" pdupre@gmx.com Subject: Re: crond
On Sat, Jun 22, 2024, at 7:17 AM, Patrick Dupre via users wrote:
Hello,
I have a backup launched by cron.weekly However, since F40, after it has run a first time and ended, another backup is started. This messed up the backup.
When starting, the first crond sent (ps -aux | grep -i backup | mail -s Backup root@localhost.localdomain) root 19672 0.0 0.0 228476 3136 ? S 12:29 0:00 /bin/sh /etc/cron.weekly/backup.cron
[snip]
and the second one
root 29787 0.0 0.0 228476 3260 ? S 14:55 0:00 /bin/sh /etc/cron.weekly/backup.cron.saved
If you run:
ls -la /etc/cron.weekly/
I think you will find a "regular" and a ".saved" copy of your cron script.
On Jun 22, 2024, at 10:34, Patrick Dupre via users users@lists.fedoraproject.org wrote:
ls -la /etc/cron.weekly/
drwxr-xr-x. 2 root root 4096 Jun 22 16:14 . drwxr-xr-x. 248 root root 20480 Jun 22 16:04 .. -rwxr-xr-x. 1 root root 1685 Jun 8 16:17 backup3 -rwxr-xr-x. 1 root root 3563 Jun 8 16:36 backup.cron -rwxr-xr-x. 1 root root 3561 Jun 6 22:55 backup.cron.saved
Good, it seems that (during the update?), a backup.cron.saved has been created. I guess that I can just moved to backup.cron_saved
The Cron daemon will not modify those files, and that’s not the naming suffix that RPM updates will create, which would only happen if the file was a package anyway. You had to have created that file. Perhaps you forgot?
Also, renaming it to yet another suffix will not stop it from running along side the backup.cron. You need to remove it from the directory to get it to stop executing a second cron job.
Subject: Re: crond
On Jun 22, 2024, at 10:34, Patrick Dupre via users users@lists.fedoraproject.org wrote:
ls -la /etc/cron.weekly/
drwxr-xr-x. 2 root root 4096 Jun 22 16:14 . drwxr-xr-x. 248 root root 20480 Jun 22 16:04 .. -rwxr-xr-x. 1 root root 1685 Jun 8 16:17 backup3 -rwxr-xr-x. 1 root root 3563 Jun 8 16:36 backup.cron -rwxr-xr-x. 1 root root 3561 Jun 6 22:55 backup.cron.saved
Good, it seems that (during the update?), a backup.cron.saved has been created. I guess that I can just moved to backup.cron_saved
The Cron daemon will not modify those files, and that’s not the naming suffix that RPM updates will create, which would only happen if the file was a package anyway. You had to have created that file. Perhaps you forgot?
Also, renaming it to yet another suffix will not stop it from running along side the backup.cron. You need to remove it from the directory to get it to stop executing a second cron job.
Even if I remove the x right ?
-- Jonathan Billings -- _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On Sat, 2024-06-22 at 23:02 +0200, Patrick Dupre via users wrote:
Even if I remove the x right ?
That kind of thing will always depend on how a script is handled.
If it's run directly by a shell, then the shell *may* care about eXecute bit. Likewise, if its *run* by a handler. But if it's essentially a *configuration* for some handler, it's probably ignored.
You can always test this. Put a test script into cron.hourly without the X bit set, and see if it runs. I'd always prefer to test things like this than take someone else's word for it. Sometimes even man files may lead you up the garden path.
If you have configuration scripts you want to keep, but want disabled, it's safer (more predictable) to store them somewhere else than where they're normally accessed.
You could move them into a /etc/cron.weekly.disabled/ directory.
Once upon a time, Tim ignored_mailbox@yahoo.com.au said:
On Sat, 2024-06-22 at 23:02 +0200, Patrick Dupre via users wrote:
Even if I remove the x right ?
That kind of thing will always depend on how a script is handled.
They do need to be executable for run-parts to run them. There are a handful of filenames that are skipped though:
*~ *, *.cfsaved *.rpmsave *.rpmorig *.rpmnew *.swp *,v
If you want to make a backup but not have extra runs, use something like "foo.save~".