Skip to content

Instantly share code, notes, and snippets.

@rszamszur
Created August 29, 2021 18:13
Show Gist options
  • Save rszamszur/2dfb4d512821fe63cfe23153a3e448ba to your computer and use it in GitHub Desktop.
Save rszamszur/2dfb4d512821fe63cfe23153a3e448ba to your computer and use it in GitHub Desktop.
Backup reMarkable content
#!/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