Manage Nextcloud snap with snap
Snap manual pages
man snap
Snap help
snap --help
Contextual help
snap <command> --help
also
snap <command> <option> --help
Documentation and further reading:
View installed enabled snaps on host
List enabled snaps on host
sudo snap list
View all snaps on host
List all snaps and revisions on host
sudo snap list --all
Enable Nextcloud snap
Enable Nextcloud snap to start automatically
sudo snap enable nextcloud
Disable Nextcloud snap
Disable Nextcloud snap from starting automatically
sudo snap disable nextcloud
Start Nextcloud snap
Start Nextcloud snap manually
sudo snap start nextcloud
Stop Nextcloud snap
Stop Nextcloud snap manually
sudo snap stop nextcloud
Restart Nextcloud snap
Restart Nextcloud snap manually
sudo snap restart nextcloud
Managing automatic updates
Nextcloud snap is designed to update (refresh) automatically by default. You have full control to manage if and when your Nextcloud snap is updated with snapd daemon! See managing updates.
NOTE
Snaps update automatically, and by default, the snapd daemon checks for updates 4 times a day. Each update check is called a refresh.
Updates can be set to occur on Friday at midnight, or for specific days of the month, such as only the third Monday, or even the last Friday of the month, between 23:00 to 01:00 the next day. They can even be postponed indefinitely, or for a set period of time.
When, if, and how often, these updates occur is the job of the snap refresh command.
Update Nextcloud snap
Update Nextcloud snap manually
sudo snap refresh nextcloud
Revert Nextcloud snap
Revert Nextcloud snap to last retained revision
sudo snap revert nextcloud
Revert Nextcloud snap revision
Revert Nextcloud snap to defined revision
sudo snap revert nextcloud --revision=xxxxx
Refresh to stable channel
Refresh to stable channel
sudo snap refresh nextcloud --stable
or defined channel
sudo snap refresh --channel=xx/stable nextcloud
Snap snapshots
Functions
Backup Nextcloud snap using snap snapshots
Backup procedure
- Stop Nextcloud (optional but recommended)
sudo snap stop nextcloud
- Create snapshot
sudo snap save nextcloud
- Start Nextcloud (see 1.)
sudo snap start nextcloud
- Find snapshot (
*.zip
) in/var/lib/snapd/snapshots
and copy/move to backup media
The above procedure may be scripted (example script)
Restore Nextcloud snap using snap snapshots
- When moving to new device, be sure to install Nextcloud snap first
- Snap restore replaces previous installation incl. certs, DB and data
- See documentation in
snap restore --help
and snapcraft
Restore procedure
-
Copy snapshot (
*.zip
) from backup media to/var/lib/snapd/snapshots
-
Discover snapshot-ID using
snap saved
-
Restore snapshot
sudo snap restore "snapshot-ID"
Remove snap snapshot
sudo snap forget "snapshot-ID"
Snap retention
Use snap option refresh.retain
to set the maximum number of a snap revisions stored by the system after the next refresh:
Value = Number of revisions retained
sudo snap set system refresh.retain=2
Remove Nextcloud snap from host
This will remove Nextcloud snap from your system but will create a snapshot
sudo snap remove nextcloud
Remove Nextcloud snap completely from host
This will completely remove Nextcloud snap including revisions
sudo snap remove --purge nextcloud
Remove snapd from host
WARNING
Be sure you want to remove snapd completely
This is final! All snaps, revisions, backups and settings will be removed
CAUTION
This will completely remove snapd including all installed enabled/disabled snaps and all revisions from your system
sudo apt remove snapd