Created
August 29, 2021 18:13
-
-
Save rszamszur/2dfb4d512821fe63cfe23153a3e448ba to your computer and use it in GitHub Desktop.
Backup reMarkable content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -n "$DEBUG" ]; then | |
set -x | |
fi | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
if [[ ! -d "$1" ]]; then | |
echo "Provided backup destination dir is not a dir" | |
exit 1 | |
fi | |
if ! command -v sshfs &> /dev/null; then | |
echo "sshfs is not installed" | |
exit 1 | |
fi | |
if ! command -v rsync &> /dev/null; then | |
echo "rsync is not installed" | |
exit 1 | |
fi | |
mount_dir=$(mktemp -d) | |
sshfs remarkable:/home/root "${mount_dir}" | |
rsync -av "${mount_dir}" "${1}" | |
umount "${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment