Scheduling EBS Snapshots Using Crontab

If using a backup strategy that involves EBS snapshots, best practice is to schedule a cron job that leverages the EBS Backup and Restore features of SoftNAS.

We now make this script available to you via the softnas-cmd API. The script will store the snapshots in your AWS account under the EC2 Snapshots console and they will also be seen in the SoftNAS Storage Manager console in the "EBS Backup and Restore" tab. Please note that the retention policy has now been removed and you can create as many EBS snapshots as you want. You also have the ability to manually clean up old EBS snapshots from the UI.

Step-by-step guide using IAM policy:

  1. Make sure that you are using the SoftNAS_HA_IAM role and it is attached to your SoftNAS instance.
  2. As the 'root' user, schedule the below cron. For this example, we will use every 8 hours for the snapshot interval (*/8 in the hourly place holder):
  3. "crontab -e" to edit the crontab.
  4. Add this line: "0 */8 * * *  softnas-cmd login softnas <password> && softnas-cmd ebs_backup create > /dev/null 2>&1" 

Step-by-step guide using AWS Managed KMS Keys:

  1. As either 'root' or 'ec2-user', schedule the below cron. I'm using every 8 hours for my snapshot interval (*/8 in the hourly place holder):
  2. "crontab -e" to edit the crontab.
  3. Add this line: "0 */8 * * * softnas-cmd login softnas <password> && softnas-cmd ebs_backup create '<yourAccessKey>' '<yourSecretKey>' > /dev/null 2>&1"