This is a small shell script which can be used to backup edited Joplin resources, since this is, as of time of writing, still an open issue. Should work on any GNU/Linux or MacOS machine since it just uses POSIX utils.
Note that you should manually set the env variables JOPLIN_CURRENT_DIR
(where Joplin currently saves everything) and JOPLIN_BACKUP_DIR
(where the backup directory is); usually the former is ${HOME}/.config/joplin-desktop
(the default value), and the latter is determined by the user (default value is ${HOME}/.joplin-backup
).
Usage:
sh editable-resources.sh
If you don't want to be prompted whether the directory info is correct (which you should check!), you can just do:
yes | sh editable-resources.sh
This can of course be coupled with something like cron
to make backups on a regular basis; for instance, to backup every hour at 00 minutes, you can do something like this:
(crontab -l ; echo "0 * * * * sh /path/to/editable-resources.sh")| crontab -