Add scripts to install Terraform and take snapshots in Arch Linux

This commit is contained in:
greg
2024-01-02 05:19:58 -08:00
parent 739b517db4
commit 7167ace3f3
2 changed files with 44 additions and 0 deletions

20
scripts/snapshot-arch.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Exit if any command fails and treat unset variables as an error
set -eu
# Define the source and destination directories
src_dir="$HOME/Desktop"
dst_dir="$HOME/snapshots"
# Ensure the destination directory exists
mkdir -p "$dst_dir"
# Create a snapshot of the source directory
btrfs subvolume snapshot "$src_dir" "$dst_dir/desktop_snapshot_$(date +%Y%m%d%H%M%S)"
#/etc/crontab
# System Reboot takes a snapshot
# @reboot $HOME/snapshots/snapshot.sh
# Every 12 hours take a snapshot
# 0 */12 * * * $HOME/snapshots/snapshot.sh