mirror of
https://github.com/brunofontes/linuxShortcuts.git
synced 2025-04-20 09:57:12 +00:00
Compare commits
2 Commits
b34416de14
...
2b36d7c555
Author | SHA1 | Date | |
---|---|---|---|
2b36d7c555 | |||
7a28fde055 |
1
Services/backup-contabo.env
Normal file
1
Services/backup-contabo.env
Normal file
@ -0,0 +1 @@
|
|||||||
|
CONTABO_BACKUP_PATH="/home/bruno/Backups/Contabo"
|
1
Services/backup-contabo.service
Executable file → Normal file
1
Services/backup-contabo.service
Executable file → Normal file
@ -3,3 +3,4 @@ Description=Backup contabo daily
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/home/bruno/Backups/Contabo/backup-contabo.sh
|
ExecStart=/home/bruno/Backups/Contabo/backup-contabo.sh
|
||||||
|
EnvironmentFile=/home/bruno/Apps/linuxShortcuts/Services/backup-contabo.env
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
if [[ `nmcli -t -f GENERAL.METERED dev show | grep "METERED:yes"` ]]; then
|
||||||
|
echo Backup does not work on metered connections
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $CONTABO_BACKUP_PATH ]]; then
|
if [[ -z $CONTABO_BACKUP_PATH ]]; then
|
||||||
echo CONTABO_BACKUP_PATH environment not set
|
echo CONTABO_BACKUP_PATH environment not set
|
||||||
exit 1
|
exit 1
|
||||||
|
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