Introduction
Expected Outcome
Successfully setup snapshots schedule via the replicated CLI.
Prerequisites
- Terraform Enterprise
- Deprecated POC(Proof of Concept) Operational Mode
Use Case
When access to the Replicated dashboard is limited and is necessary to setup or change the snapshots schedule.
Procedure
-
Connect to the instance via SSH
- Check the current Replicated Snapshots settings
$ replicatedctl params export|grep -i snapshot
"SnapshotsBindAddress": "0.0.0.0:9878",
"SnapshotsAdvertiseAddress": "192.168.78.152:9878",
"SnapshotsStore": "local",
"SnapshotsPath": "/var/lib/replicated/snapshots",
"SnapshotsS3Bucket": "",
"SnapshotsS3Folder": "",
"SnapshotsAWSRegion": "",
"SnapshotsAWSKeyID": "",
"SnapshotsAWSSecretKey": "",
"SnapshotsAWSServerSideEncryption": "",
"SnapshotsAWSSSEKMSKeyID": "",
"SnapshotsAWSS3CompatibleEndpoint": "",
"SnapshotsSFTPHost": "",
"SnapshotsSFTPUsername": "",
"SnapshotsSFTPPrivateKeyPEM": "",
"SnapshotsSFTPPrivateKeyPEMFilename": "",
"SnapshotsSchedule": "5 21 * * Thu",
"DisableScheduledSnapshots": false, < - - Set to true to disable snapshots
"SnapshotsMaxBackups": 3,
"SnapshotsTimeout": 0,
"RetracedSnapshotMaxFilesize": "128m", - Check the date in Replicated as it might differ from the Host
$ docker exec replicated date
Fri Sep 30 14:20:45 UTC 2022
- Setup the snapshots schedule
# Hourly
replicatedctl params set SnapshotsSchedule --value '@hourly'
# Daily (example 8:30 PM)
replicatedctl params set SnapshotsSchedule --value '30 20 * *'
# Weekly (example 9:00 AM Saturday)
replicatedctl params set SnapshotsSchedule --value '0 9 * * Sat'
Additional Information
-
We do not recommend using snapshots as a backup strategy regardless of the operational mode. Use the Backup and Restore API and refer to the Terraform Enterprise Backup - Recommended Patterns for more in-depth Cloud specific recommendations.