Skip to content

Instantly share code, notes, and snippets.

@ralphscheu
Created July 10, 2022 11:55
Show Gist options
  • Save ralphscheu/1cd684dcad8ce4368967812bdf0734bc to your computer and use it in GitHub Desktop.
Save ralphscheu/1cd684dcad8ce4368967812bdf0734bc to your computer and use it in GitHub Desktop.
Remote Backup Script of Seafile userdata using seaf-fuse and rclone
#!/usr/bin/env bash
if [ -z "$(ls -A /mnt/seafile-fuse)" ]; then
echo "Mountpoint /mnt/seafile-fuse empty, mounting Seafile using seaf-fuse.sh..."
echo "/opt/seafile/seafile-server-latest/seaf-fuse.sh start /mnt/seafile-fuse"
/opt/seafile/seafile-server-latest/seaf-fuse.sh start /mnt/seafile-fuse
fi
if [ -z "$(ls -A /mnt/seafile-fuse)" ]; then
echo "Failed to mount Seafile: /mnt/seafile-fuse still empty! Aborting..."
else
echo "Starting rclone backup..."
rclone sync --transfers 8 --fast-list /mnt/seafile-fuse/ b2crypt:seafile-fuse --verbose --log-file /root/b2_backup.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment