As you know bash is not ideal with multi arrays. Frequently I find myself wanting to read something like json into bash and loop over it. There are many ways to do this including readarray etc. I found this to work best for me. Note json can have lists so…
restic set tags
In a follow up to previous post https://blog.ls-al.com/restic-create-backup-and-set-tag-with-date-logic here is some code I used to set tags on old snapshots to comply with my new tagging and pruning.
Restic create backup and set tag with date logic
Also see previous post https://blog.ls-al.com/bash-date-usage-for-naming if you are interested. This post is similar but more specific to restic tagging. Below is a test script and a test run. At the time of restic backup I create a tag in order to do snapshot forget based on tags. Below is the…
AWS Cloudwatch Cron
I was trying to schedule a once a week snapshot of a EBS volume and getting “Parameter ScheduleExpression is not valid“. Turns out I missed something small. If you schedule using a cron expression note this important requirement: One of the day-of-month or day-of-week values must be a question mark…
Oracle OCI CLI Query
Some bash snippets of using –query, jq and interacting with Bash to manipulate into variables. Collect boot volume’s id Collect instance ocid Stop instance and collect the id (or whatever you need from the json) Collect the work-request-id to monitor in a loop after I export a custom image to…
Restic snapshot detail json to csv
Restic shows details of a snapshot. Sometimes you want that to be CSV but the json output for paths, excludes and tags are lists which will choke the @csv jq filter. Furthermore not all snapshots have the excludes key. Here are some snippets on solving above. Use join to collapse…
SHIPS Password Rotation
As explained on the website “unique and rotated local super user or administrator passwords for environments where it is not possible or not appropriate to disable these local accounts“. I tested as a proof of concept how to: setup a SHIPS server on CentOS7 configure SHIPS folder and ACL’s for…
POC of drdb replication
My notes of a quick drdb test… The Distributed Replicated Block Device (DRBD) provides a networked version of data mirroring, classified under the redundant array of independent disks (RAID) taxonomy as RAID-1. Showing status, add a file and check target… After initial sync: Create filesystem and some data: Switch roles…
zfsbackup-go test with minio server
Recording my test with zfsbackup-go. While I am playing around with backup/DR/object storage I also compared the concept here with a previous test around restic/rclone/object storage. In general ZFS snapshot and replication should work much better with file systems containing huge numbers of files. Most solutions struggle with millions of…