scheduled jobs

  • Hello,


    in webgui in Scheduled jobs I have one job, see attach. My crontab seems like this, see attach. I should run on sundays. It doesnt seems to me... Server is often at this time off, so anacron should do this. Anyway seems to me it is not running even if the server is on. I can not find this job in folder cron.weekly, see attach. In log /var/log/cron-apt/log there is nothing. Running the script manually is ok, even in the webgui. Please help. Thank you.

  • Well, it seems ok:


    Code
    /etc/cron.d/openmediavault-userdefined      
    SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    # m h dom mon dow user    command
    @weekly root /var/lib/openmediavault/cron.d/userdefined-eaa23924-1b89-4b90-95ac-a84223661878
    Code
    /var/lib/openmediavault/cron.d/us~3924-1b89-4b90-95ac-a84223661878
    #!/bin/sh# This configuration file is auto-generated.
    # WARNING: Do not edit this file, your changes will be lost.
    /root/clamscanDisk

    Anyway it is not running by cron weekly.

  • Oh, I see now. I always thought that
    00 17 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    in crontab is doing the job from webgui. And its not. The jobs from wegui have nothing to do with the lines in crontab. Its a pitty, it could be, anacron is good for home servers that used to be off. Anyway I probably use cron.weekly folder that is served by anacron.

  • The scheduled jobs uses cron not anacron

    This is interesting particularily @ryecoaaron wrote in this thread post no. 2 about the anacron plugin rsnapshot + autoshutdown/WOL - flexible daily backups

    The anacron plugin was stopped because the anacron functionality is now integrated into scheduled tasks.

    So it seems that in the past there was a dedicated anacron plugin, which became redundant.


    I did a lot of investigations and tests and I never get it to run that a cron job was executed later by anacron. If the OMV Nas was switched off when a cron job had to be executed, it was never executed later when the NAS was switched on again. So I cannot comprehend ryecoaaron´s statement.


    I found this thread Anacron Daily won't Execute and it leads me to the solution I found at the end:
    1. Copy your script to
    - /etc/cron.hourly for hourly execution
    - /etc/cron.daily for daily execution
    - /etc/cron.weekly for weekly execution
    - /etc/cron.monthly for monthly execution
    2. The script must not have any file extension (.sh ) because otherwise it is not executed by anacron run-parts.
    3. Of course the executable bit of the script must be set.
    4. It is not necessary to define the job also in OMV Scheduled Jobs. In this case it could be that the job is executed twice.
    Nevertheless I did it because it is a good possibility to test the script manually. But afterwards I disabled the entry.



    In this way every job is executed by anacron later when the OMV Nas is switched on again. Not immediately but within one hour after switching on.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    2 Mal editiert, zuletzt von cabrio_leo ()

    • Offizieller Beitrag

    I guess I can port the anacron plugin to omv 3.x.

  • I told @ryecoaaron that anacron was built in ST, it was a mistake, since it was using just abbreviations for some equivalent cron dates that are documented in crontab man. It looked similar, they should work the same if nas is on all the time.

    I am not sure if I have understood that sentence properly, but it sounds to me that there is currently (OMV 3.0.84) no anacron support in scheduled task.
    Please do not misunderstand, I don´t want to blame anybody! It´s only for my clarification, because there a some threads in this forum, which deals with anacron functionality, but didn´t help me to get it going.


    Thus is it right that there are two possible solutions currently?


    a) Adding a script in /etc/cron.xxx - folder like described above in post no. 10


    b) Wait until @ryecoaaron has ported the old anacron plugin.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    • Offizieller Beitrag

    Wait until @ryecoaaron has ported the old anacron plugin.

    I ported the plugin and it is in the testing repo. Seems to be working for me.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!