mirror of
https://github.com/brunofontes/linuxShortcuts.git
synced 2024-11-23 23:40:51 +00:00
Joplin backup script
This commit is contained in:
parent
b34416de14
commit
7a28fde055
6
Services/backup-joplin.service
Executable file
6
Services/backup-joplin.service
Executable 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
15
Services/backup-joplin.sh
Executable 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
11
Services/backup-joplin.timer
Executable 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
|
Loading…
Reference in New Issue
Block a user