diff options
-rw-r--r-- | docs/todo.md | 15 | ||||
-rwxr-xr-x | share/hydractl/sync-backups | 4 | ||||
-rwxr-xr-x | share/hydractl/sync-media | 10 | ||||
-rwxr-xr-x | share/hydractl/sync-media-initremotes | 2 |
4 files changed, 25 insertions, 6 deletions
diff --git a/docs/todo.md b/docs/todo.md index 48cbf94..3da4275 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -4,8 +4,9 @@ * [ ] Deploy: * [ ] Collect basic hardware information along with facts: cpuid, - dmidecode, hwinfo, lsblk, lscpu, lshw, lspci, lsusb etc. + dmidecode, hwinfo, lsblk, lscpu, lshw, lspci, lsusb, sfdisk etc. Store somewhere under the `config/hardware` folder? + Could also be a separate action, `hydra <hydra> collect <node>`. * [ ] Command line is broken for ansible when multiple nodes are provided. * [ ] Use console-based GnuPG agent when calling `keyringer`. * [ ] Mass: @@ -24,9 +25,19 @@ > [perhaps a '--transport=<tn>' or '--vendor=<vn>' option is needed] * [ ] Mount/umount system volume supporting split partiton scheme (`root`, `var`, `home` etc). - * [ ] Try to detected the device partition (`/dev/sdb1` etc) based + * [ ] Try to detect the device partition (`/dev/sdb1` etc) based on the LUKS2 label. + * [ ] Cryptdisks script needs fixing as `systemd-tty-ask-password-agent` is not + catching cryptsetup password prompts anymore. Otherwise, consider to + deprecate this script. * [ ] Syncing: + * [ ] Sync lock, respected by other applications such as `docshower` + from [utils-doc][https://git.fluxo.info/utils-doc]. + * [ ] Run `git submodule --update --init --recursive` after running + `git annex sync`. + * [ ] Shall `sync-media` do a `git unannex` on sidecar and other metadata + files and manage them through Git instead, or keep them as unlocked + files? * [ ] Syncing packages: a frontend to `apt-offline` that uses `git-annex` repositories: getting, installing, cleaning. One node can request packages through an external drive, and another can fetch then. diff --git a/share/hydractl/sync-backups b/share/hydractl/sync-backups index 9cc79de..63e11b4 100755 --- a/share/hydractl/sync-backups +++ b/share/hydractl/sync-backups @@ -84,13 +84,13 @@ fi # Check volume name if [ "$VOLUME" == "`hostname -f`" ]; then - echo "volume is the hostname, cannot sync to myself" + echo "$BASENAME: volume is the hostname, cannot sync to myself" exit 1 fi # Check if it is mounted if ! mount | grep -q $MEDIA; then - echo "volume $MEDIA is not mounted" + echo "$BASENAME: volume $MEDIA is not mounted" exit 1 fi diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media index 8132315..0976c68 100755 --- a/share/hydractl/sync-media +++ b/share/hydractl/sync-media @@ -171,12 +171,16 @@ if echo $OPTIONS | grep -q -- "--dropunused"; then fi # Set drive config -# Ingore drive/volume if it's set to "local" +# Ignore drive/volume if it's set to "local" if [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ] && [ "$REMOTE" != "localhost" ]; then # Check storage media MOUNT="`mount | grep $VOLUME`" + if [ ! -z "$MOUNT" ]; then DRIVE="$(basename `echo $MOUNT | awk '{ print $1 }'`)" + #else + # echo "$BASENAME: volume $MEDIA is not mounted" + # exit 1 fi fi @@ -244,6 +248,8 @@ for folder in $REPOSITORIES; do # Repository maintenance sync_media_fsck sync_media_dropunused + git prune + git gc ) fi @@ -311,6 +317,8 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then sync_media_getall $VOLUME/$MEDIA/$folder sync_media_fsck sync_media_dropunused + git gc + git prune #git annex drop --auto --numcopies=2 ) elif [ -d "$CACHE/$folder" ] && [ ! -d "$CACHE/$folder/.git" ]; then diff --git a/share/hydractl/sync-media-initremotes b/share/hydractl/sync-media-initremotes index 839deea..5b851f6 100755 --- a/share/hydractl/sync-media-initremotes +++ b/share/hydractl/sync-media-initremotes @@ -7,7 +7,7 @@ BASENAME="`basename $0`" VOLUME="$1" TYPES="$2" -DOMAIN="`facter DOMAIN`" +DOMAIN="`facter domain`" HOST="`facter hostname`" CACHES="" VOLUMES="" |