Joplin backup script

This commit is contained in:
Bruno F. Fontes 2021-02-23 08:57:25 -03:00
parent b34416de14
commit 7a28fde055
Signed by: brunofontes
GPG Key ID: EE3447CE80048495
3 changed files with 32 additions and 0 deletions

6
Services/backup-joplin.service Executable file
View File

@ -0,0 +1,6 @@
[Unit]
Description=Backup joplin weekly
[Service]
User=bruno
ExecStart=/home/bruno/Apps/linuxShortcuts/Services/backup-joplin.sh

15
Services/backup-joplin.sh Executable file
View File

@ -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"

11
Services/backup-joplin.timer Executable file
View File

@ -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