1

I live in a remote area, and my internet is satellite based. The data is expensive, and limited, however overnight it isn't metered, and data moves faster. How can I schedule software updater to perform updates at night? I've seen many similar questions to mine, but no answers. Is there a simple to moderately tech savvy script one could write?

1

1 Answer 1

3

Edit the systemd timers for apt

There are three settings to change:

  1. /lib/systemd/system/apt-daily.timer

This provides your daily apt update, refreshing the package database. Change this section:

     [Timer]
     OnCalendar=*-*-* 6,18:00   // Try *-*-* 02:17 for nightly at 0217 (2:17 am)
     RandomizedDelaySec=12h     // Comment out this line (prepend with a '#') - you don't want random delay
     Persistent=true            // Keep this line
  1. /lib/systemd/system/apt-daily-upgrade.timer

This provides your daily Unattended Upgrades, installing security upgrades. The previous job MUST run first - calculating the upgrade requires reading the package database. Change this section:

     [Timer]
     OnCalendar=*-*-* 06:00     // Try *-*-* 03:17 for nightly at 0317 (3:17 am)
     RandomizedDelaySec=60m     // Comment out this line (prepend with a '#') - you don't want random delay
     Persistent=true            // Keep this line
  1. /etc/cron.daily/apt-compat

This job adds additional randomness to apt. The purpose is to avoid overloading mirrors by distributing job across time randomly. You accomplished the spirit of this goal by setting the other apt jobs to an unusual time (like 17 minutes past the hour).Change this section:

     # delay the job execution by a random amount of time
     random_sleep               // Comment out this line by adding a '#' in front.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .