What's new

Rclone (Entware-NG) issues configuring and syncing

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I have run with the cool solution in this thread for automating backups using rclone upon filesystem change. In my case I have my scanner send scans to network share. Router picks up change on file system and then effects an rsync copy to OneDrive.

Does anyone see any issues (especially safety issues in terms of CPU usage or anything else) with this script I put together:

/jffs/scripts/backup-scans
Code:
#!/bin/bash

log_dir="/mnt/-/backup-scans-log.txt"
config_dir="/mnt/-/rclone_config"
backup_dir="/mnt/-/shares/Scanned Documents/"
server_backup_dir="OneDrive:/Scanned Documents/"

function backup () {
        rclone --config /mnt/-/rclone_config copy "$backup_dir" "$server_backup_dir" 2>&1 >>"$log_dir"
}

while true
do
        inotifywait -r -e modify,attrib,close_write,move,create,delete  --format '%T %:e %f' --timefmt '%c' "$backup_dir"  2>&1 >>"$log_dir" && backup
done

Is it safe to have such a while / do loop? Should I place a sleep (5) or equivalent in case the inotifywait doesn't work properly?

The backup script that I have based this on:


includes the line:

trap 'kill -HUP 0' EXIT

I left this out. Not sure if it is needed?

To launch this script I have added the line:

admin@RT-AX86U-4168:/jffs/scripts# cat post-mount
Code:
#!/bin/sh
swapon /tmp/mnt/-/myswap.swp # Added by amtm
. /jffs/addons/diversion/mount-entware.div # Added by amtm
/jffs/scripts/spdmerlin startup "$@" & # spdMerlin
/jffs/scripts/backup-scans
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top