diff --git a/Services/backup-joplin.service b/Services/backup-joplin.service new file mode 100755 index 0000000..98ba1b3 --- /dev/null +++ b/Services/backup-joplin.service @@ -0,0 +1,6 @@ +[Unit] +Description=Backup joplin weekly + +[Service] +User=bruno +ExecStart=/home/bruno/Apps/linuxShortcuts/Services/backup-joplin.sh diff --git a/Services/backup-joplin.sh b/Services/backup-joplin.sh new file mode 100755 index 0000000..3500a65 --- /dev/null +++ b/Services/backup-joplin.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +BACKUP_DIR="/home/bruno/Backups/Joplin" +JOPLIN_BIN="/bin/joplin" + +$JOPLIN_BIN sync +$JOPLIN_BIN e2ee decrypt + +# Delete old backups +cd "$BACKUP_DIR" +rm -r "./joplin.jex" +rm -rf "./MD" + +$JOPLIN_BIN --log-level debug export --format jex "$BACKUP_DIR/joplin.jex" +$JOPLIN_BIN --log-level debug export --format md "$BACKUP_DIR/MD" diff --git a/Services/backup-joplin.timer b/Services/backup-joplin.timer new file mode 100755 index 0000000..72f5630 --- /dev/null +++ b/Services/backup-joplin.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Backup joplin weekly + +[Timer] +Persistent=true +OnCalendar=Thu *-*-* 10:10:00 +WakeSystem=true +#DayOfWeek Year-Month-Day Hour:Minute:Second + +[Install] +WantedBy=timers.target