Jump to content

Sunri5e

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Sunri5e

  1. (I'm not responsible for any damage)

    I made a manual anacron setup via go script:

     

    #!/bin/bash
    # Start the Management Utility
    /usr/local/sbin/emhttp &
    
    # copy anacron binary and set permissions
    cp /boot/config/anacron/anacron /usr/sbin/
    chmod 755 /usr/sbin/anacron
    
    # start anacron if all is ready
    if [ -x /usr/sbin/anacron -a -f /boot/config/anacron/anacrontab ]; then
    /usr/sbin/anacron -s -t /boot/config/anacron/anacrontab -S /boot/config/anacron/spool/
    fi
    

     

     

    # /etc/anacrontab: configuration file for anacron
    
    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=45
    # 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 /boot/config/anacron/cron.daily
    7       25      cron.weekly             nice run-parts /boot/config/anacron/cron.weekly
    @monthly 45     cron.monthly            nice run-parts /boot/config/anacron/cron.monthly
    

     

    All you need is an anacron binary in /usr/sbin/ and to create all needed directories/your anacron scripts.

     

  2. I only use unRAID as hypervisor for my gaming machine and dont have it 24/7 running.

     

    Currently you are using crontab to run scheduled tasks but if my system is not running at this time, the cronjob is not executed.

     

    It would be nice if you could implement anacron as second choice.

     

    #/bin/bash
    
    # Concatenate the current set of plugin-specific cron files
    # into single system crontab.
    
    ENTRIES=$(cat /boot/config/plugins/*/*.cron 2>/dev/null)
    if (($? != 0)); then
      crontab -c /etc/cron.d -d
    else
      echo "$ENTRIES" | crontab -c /etc/cron.d -
    fi
    

×
×
  • Create New...