Sat 14 Sep 00:03:25 CEST 2024
This commit is contained in:
parent
0885df1411
commit
b2949528a2
|
@ -4,36 +4,34 @@ let
|
||||||
disk_check = import ./utils/disk_check.nix { inherit pkgs; };
|
disk_check = import ./utils/disk_check.nix { inherit pkgs; };
|
||||||
vdirsyncer = {
|
vdirsyncer = {
|
||||||
when = "*:0/15";
|
when = "*:0/15";
|
||||||
|
script = toString (pkgs.writeShellScript "script" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair '');
|
||||||
|
};
|
||||||
|
mbsync = {
|
||||||
|
when = "*-*-* 00:00:00";
|
||||||
script = toString (pkgs.writeShellScript "script" ''
|
script = toString (pkgs.writeShellScript "script" ''
|
||||||
${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
mbsync = {
|
|
||||||
when = "*-*-* 00:00:00";
|
|
||||||
script = toString (pkgs.writeShellScript "script" ''
|
|
||||||
BASEDIR=/home/server/Containers/mbsync
|
BASEDIR=/home/server/Containers/mbsync
|
||||||
# python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json
|
# python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json
|
||||||
docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a
|
docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a
|
||||||
${pkgs.notmuch}/bin/notmuch new
|
${pkgs.notmuch}/bin/notmuch new
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
sync_vault = {
|
sync_vault = {
|
||||||
when = "*-*-* 02:00:00";
|
when = "*-*-* 02:00:00";
|
||||||
script = toString (pkgs.writeShellScript "script" ''
|
script = toString (pkgs.writeShellScript "script" ''
|
||||||
source $HOME/.secrets/Backup/env.sh
|
source $HOME/.secrets/Backup/env.sh
|
||||||
for _ in {1..2}; do
|
for _ in {1..2}; do
|
||||||
OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1);
|
OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1);
|
||||||
if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then
|
if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then
|
||||||
echo "Key successfully loaded, starting syncoid"
|
echo "Key successfully loaded, starting syncoid"
|
||||||
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace
|
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace
|
||||||
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T
|
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T
|
||||||
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Niels 10.4.0.1:Vault/Thomas/Encrypted/Storage/N
|
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Niels 10.4.0.1:Vault/Thomas/Encrypted/Storage/N
|
||||||
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y
|
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y
|
||||||
syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers
|
syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers
|
||||||
ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted
|
ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted
|
||||||
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R
|
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Found output instead: $OUTPUT"
|
echo "Found output instead: $OUTPUT"
|
||||||
|
@ -41,12 +39,12 @@ let
|
||||||
exit 1
|
exit 1
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
backup = {
|
backup = {
|
||||||
when = "*-*-* 04:00:00";
|
when = "*-*-* 04:00:00";
|
||||||
script = toString (pkgs.writeShellScript "script" ''
|
script = toString (pkgs.writeShellScript "script" ''
|
||||||
${./scripts/files/backup.sh}
|
${./scripts/files/backup.sh}
|
||||||
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0
|
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue