diff --git a/.config/systemd/user/basic.target.wants/restic-backup.timer b/.config/systemd/user/basic.target.wants/restic-backup.timer new file mode 120000 index 00000000..cbd65901 --- /dev/null +++ b/.config/systemd/user/basic.target.wants/restic-backup.timer @@ -0,0 +1 @@ +/home/cyryl/.config/systemd/user/restic-backup.timer \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/restic-backup.service b/.config/systemd/user/default.target.wants/restic-backup.service new file mode 120000 index 00000000..da247a28 --- /dev/null +++ b/.config/systemd/user/default.target.wants/restic-backup.service @@ -0,0 +1 @@ +/home/cyryl/.config/systemd/user/restic-backup.service \ No newline at end of file diff --git a/.config/systemd/user/restic-backup.service b/.config/systemd/user/restic-backup.service new file mode 100644 index 00000000..4ef0ff13 --- /dev/null +++ b/.config/systemd/user/restic-backup.service @@ -0,0 +1,8 @@ +[Unit] +Description=Restic backup service + +[Service] +ExecStart=restic -p $HOME/.vault/restic-password-file -r sftp:fetcher@10.0.0.101:/mnt/data/backup-targets/ --exclude-file $HOME/.vault/restic-exclude --verbose backup $HOME/ + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/restic-backup.timer b/.config/systemd/user/restic-backup.timer new file mode 100644 index 00000000..222d6089 --- /dev/null +++ b/.config/systemd/user/restic-backup.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for restic-backup + +[Timer] +OnBootSec=2m +OnUnitInactiveSec=1d +Persistent=true + +[Install] +WantedBy=basic.target diff --git a/fedora/Dockerfile b/fedora/Dockerfile index 7453da9a..056e4171 100644 --- a/fedora/Dockerfile +++ b/fedora/Dockerfile @@ -53,7 +53,7 @@ RUN curl -sSL https://get.rvm.io | bash RUN bash -c "source /etc/profile.d/rvm.sh && rvm install ruby --disable-binary" # basic packages -RUN dnf -y --best --allowerasing install tmux atop zsh aria2 lm_sensors python3-pip whois curl pv terminator gsmartcontrol python-pip mercurial cmake glances dkms git xz util-linux-user dnf-automatic yum-utils util-linux-user archivemount redhat-rpm-config grub2 grub2-efi dracut dracut-tools fail2ban syncthing wget wireguard-dkms wireguard-tools parted lsscsi ksh dnf-plugins-core +RUN dnf -y --best --allowerasing install tmux atop zsh aria2 lm_sensors python3-pip whois curl pv terminator gsmartcontrol python-pip mercurial cmake glances dkms git xz util-linux-user dnf-automatic yum-utils util-linux-user archivemount redhat-rpm-config grub2 grub2-efi dracut dracut-tools fail2ban syncthing wget wireguard-dkms wireguard-tools parted lsscsi ksh dnf-plugins-core restic duply # printing RUN dnf -y --best --allowerasing install splix gutenprint-cups cups-bjnp diff --git a/fedora/up.sh b/fedora/up.sh index 35529c3e..36fad72c 100755 --- a/fedora/up.sh +++ b/fedora/up.sh @@ -2,6 +2,8 @@ set -e +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + sudo dnf -y groupinstall "C Development Tools and Libraries" sudo dnf -y groupinstall "Development Tools" @@ -14,14 +16,9 @@ if [[ -z $NOUPGRADE ]]; then sudo dnf -y upgrade --best --allowerasing fi -sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel whois curl pv terminator gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel cmake gtk2-devel intltool gparted glances dkms kernel-devel gimp git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel zeal qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget wireguard-dkms wireguard-tools lldb python-lldb kdbg zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel parted lsscsi ksh openssl-devel elfutils-libelf-devel libtirpc-devel kernel-devel ffmpeg-libs dnf-plugins-core - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine +sudo dnf -y --best --allowerasing install tmux atop zsh firefox aria2 gajim lm_sensors freecad python3-pip qt5-qtbase-devel qt5-qtwebkit-devel whois curl pv terminator gsmartcontrol python-pip mercurial python3-devel libxslt-devel libjpeg-turbo-devel cmake gtk2-devel intltool gparted glances dkms kernel-devel gimp git xz util-linux-user dnf-automatic kdiff3 yum-utils util-linux-user ncurses-devel zeal qt5-linguist qtkeychain-qt5-devel archivemount keepass splix gutenprint-cups cups-bjnp golang redhat-rpm-config pcsc-lite-devel pcsc-tools pcsc-lite yubico-piv-tool yubikey-personalization-gui xloadimage yp-tools closure-compiler optipng jpegoptim grub2 grub2-efi dracut dracut-tools openssl-devel fail2ban syncthing ansible gnome-tweaks xclip wget wireguard-dkms wireguard-tools lldb python-lldb kdbg zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel parted lsscsi ksh openssl-devel elfutils-libelf-devel libtirpc-devel kernel-devel ffmpeg-libs dnf-plugins-core restic duply sudo dnf config-manager -y --add-repo https://download.docker.com/linux/fedora/docker-ce.repo - sudo dnf install -y docker-ce docker-ce-cli containerd.io sudo cp -v /etc/dnf/automatic.conf /etc/dnf/automatic.conf.bak @@ -57,6 +54,12 @@ else echo "No grub.cfg ..." fi +mkdir -p "$HOME/.config/systemd/" +rm -frv "$HOME/.config/systemd/user" + +DIR=`realpath "$DIR/../"` +ln -vfs "$DIR/.config/systemd/user" "$HOME/.config/systemd/" + if [[ -z $NO_SYSTEMCTL ]]; then sudo systemctl enable docker sudo systemctl restart docker @@ -67,6 +70,10 @@ if [[ -z $NO_SYSTEMCTL ]]; then sudo systemctl enable fstrim.timer sudo systemctl restart fstrim.timer sudo systemctl enable --now syncthing@cyryl.service + systemctl --user daemon-reload + systemctl --user enable restic-backup.timer + systemctl --user enable restic-backup.service + systemctl --user list-timers sudo systemctl list-timers fi @@ -89,6 +96,5 @@ if [ "$(id -u)" != "0" ]; then code --install-extension vscodevim.vim fi -DIR="$DIR/../" DIR="$DIR" $DIR/common/configure_fresh_system.sh