From: Ian Kelling Date: Tue, 11 Jun 2019 01:08:48 +0000 (-0400) Subject: btrbk filxes X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=3c86472e219aaf3c97b1f878b4a818644b282aba btrbk filxes Make install-my-scripts run separately else it will cause errors if installing changed version while running. --- diff --git a/btrbk-run b/btrbk-run index 187a29a..a5fd62a 100644 --- a/btrbk-run +++ b/btrbk-run @@ -255,8 +255,16 @@ else sshable=() sshfail=() + min_idle=$((60 * 15)) for h in ${targets[@]}; do if zone=$(ssh root@$h "mkdir -p /mnt/root/btrbk && date +%z"); then + if $cron && xidle=$(ssh iank@$h DISPLAY=:0 xprintidle) && [[ $xidle && $xidle -lt $min_idle ]]; then + # This is a separate ssh because xprintidle can fail and thats ok. + # Ignore this host. i sometimes use a non-main machine for testing or web browsing, knowing that + # everything will be wiped by the next backup, but I dont want it to happen as Im using + # it from cronjob. + continue + fi sshable+=($h) if [[ $zone != $local_zone ]]; then die "error: dont confuse yourself with multiple time zones. $h has different timezone than localhost" diff --git a/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service index d1c1657..299ecff 100644 --- a/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service +++ b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service @@ -4,4 +4,6 @@ After=multi-user.target [Service] Type=oneshot +ExecStart=/usr/local/bin/install-my-scripts ExecStart=/a/bin/log-quiet/sysd-mail-once btrbk /usr/local/bin/btrbk-run -q --cron +ExecStart=/usr/local/bin/install-my-scripts diff --git a/mount-latest-subvol b/mount-latest-subvol index cfcbd72..ea1d1f8 100644 --- a/mount-latest-subvol +++ b/mount-latest-subvol @@ -372,10 +372,6 @@ for vol in q a o i; do stale_dir=/nocow/btrfs-stale rm -f $stale_dir/$d - if [[ $vol == a ]]; then - # useful to keep this at the latest version - /a/exe/install-my-scripts - fi done ### disabled diff --git a/switch-mail-host b/switch-mail-host index 13209a2..cbb7e69 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -142,8 +142,6 @@ EOF $old_shell primary-setup $new_hostname -/a/bin/distro-setup/install-my-scripts - if $localhost_new; then btrbk-run -s $old_host $mp_args else