Snap supports a set of system-wide options that allow you to customise your snap environment.
As with Configuration in snaps, these options are changed with the
get commands, but with a target of system instead of a specific snap:
$ snap set system some.option="some value" $ snap get system some.option
Controlling refresh frequency
There are three system-wide options that are used to manage various aspects of your snap environment handles update frequency:
- refresh.timer: defines the refresh frequency and schedule
- refresh.metered: pauses refresh updates when network connection is metered
- refresh.retain: sets how many revisions of a snap are stored on the system
Use refresh.timer to modify when, and how frequently, your snaps are refreshed.
The following example asks the system to only refresh snaps between 4.00am and 7.00am, and 7.00pm and 10:10pm:
$ sudo snap set system refresh.timer=4:00-7:00,19:00-22:10
Other examples for the time and frequency option include:
||Mondays at 10:00, Fridays at 15:10|
||Mondays at 10:00 and 15:00, Fridays at 10:00 and 15:00|
||Monday to Wednesday and on Friday, twice between 9:00 and 11:10|
||Mondays, some time between 9:00 and 11:00, and on Wednesdays, some time between 22:00 and 23:00|
||Monday and on Wednesday, at 0:00|
||Monday through Wednesday on the 2nd week of the month, between 23:00 and 24:00|
||Last Friday of the month, from 23:00 to 1:00 the next day|
See Timer string format for a comprehensive breakdown of the syntax used to define times and frequencies.
You can check the update frequency for your environment with the
$ snap refresh --time timer: 00:00~24:00/4 last: today at 07:47 BST next: today at 12:13 BST
By default, the snap system is scheduled to refresh four times per day, as shown in the above output.
Use refresh.metered to pause and re-enable the refresh process when NetworkManager detects a metered connection, such as an LTE link with a limited data plan.
To hold refreshing snaps when on a metered connection:
$ sudo snap set system refresh.metered=hold
To allow refreshing:
$ sudo snap set system refresh.metered=null
By default, refresh is enabled when a metered connection is detected.
Use refresh.retain to set the maximum number of a snap’s revisions stored by the system:
$ sudo snap set system refresh.retain=3
The refresh.retain value can only be a number between 2 and 20 and has a default value of refresh.retain=3.
These options may be set to change the proxies to be used by the system when communicating with external sites that speak the respective protocols.
Available since snapd 2.28.
May be set to true for disabling the SSH service at startup.
Available since snapd 2.22.
Defines the behavior of the system when the power key is pressed.
May be set to one of:
Available since snapd 2.23.
Changes various settings that land onto Rasperry Pi’s traditional config.txt file.
The following options are currently available for tuning:
Please see the Raspberry Pi documentation for details on their meanings.