Best Practices

Adding rsync as an Allowed Application

FilingBox MEGA2 enhances data security by allowing specific applications access to your data. Adding rsync, a powerful file synchronization tool, can streamline your data management processes. Here’s how to set it up:

Add rsync as an Allowed Application:

Ensure rsync is installed on your device. If not, you can typically install it via your package manager.

Use the following command to allow rsync access to a specific directory. Adjust the paths according to your setup:

cd /namusoft/megaclient
./fbmegas -alwapp -add -p /usr/bin/rsync -d /path/for/sync -o rw
./fbmegas -alwapp -add -p /usr/bin/rsync -d /path/for/backup -o ao
./fbmegas -alwapp -add -p /usr/bin/rsync -d /path/for/snapshot -o ao

-p /usr/bin/rsync

This is the path to the rsync executable.

-d /path/for/sync

This is the path to the directory where rsync will synchronize files.

-d /path/for/backup

This is the path to the directory where rsync will back up files using its `-backup` option.

-d /path/for/snapshot

This is the path to the directory where rsync will synchronize files to subdirectories named with timestamps.

Note: All paths listed above are relative to the root of the mounted directory, not the root of the entire filesystem. This makes sure that the paths are understood correctly within the mounted file system.

-o rw / ao

Recommended permission for each path above

  • rw: Read/Write
  • ao: Add-Only

Using rsync with FilingBox MEGA2

Once rsync is added as an allowed application with recommended paths and permissions, you can use it to synchronize files efficiently between directories under its allowed path:

To synchronize files from a local folder to a protected folder under FilingBox MEGA2:

rsync -avz --delete --backup --backup-dir=/path/for/backup--suffix=.bak_$(date+\%Y-\%m-\%d_\%H-\%M-\%S) /source/directory/ /path/for/sync

This command copies all files from /local/folder to /path/to/synced/folder, maintaining the file structure and permissions.

To synchronize files as a snapshot from a local folder to a protected folder under FilingBox MEGA2:

rsync -avz /source/directory/ /path/for/snapshot/snapshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S)

Tips for Using rsync:

  • Validate Paths: Always ensure that the paths used with rsync are within the directories authorized by FilingBox MEGA2 to avoid access errors.
  • Test Before Execution: Use the --dry-run option with rsync initially to see what changes would occur without actually making any changes.
  • Automate Syncing: Schedule your rsync commands as a cron job for regular synchronization without manual intervention.

Security Note:

Regularly review the permissions and access paths for rsync and other allowed applications to ensure they remain secure and compliant with your organization's data policies.

Have more questions? Submit a request