Python script running in background for macOS, to automatically move Notability backups from either a OneDrive directory or a NAS to an iCloud directory, in realtime.
Functionalities :
- Automatically sends notifications to Notification Center in macOS when anything happens (copy of a file, multiple files, copy failure, app starting)
- Real-time updates
- Automatically structures the backup folder on either NAS or OneDrive by smartly inferring the structure based on the file names
- One and only one instance can run simultaneously on the same machine
pip install -r requirement.txtYou just have to fill config.ini with the corresponding paths :
- The path to your mounted iCloud folder
- Optionally: The path to your mounted OneDrive folder
- Optionally, if not above: The credentials for SFTP connection to your NAS drive.
The config.ini file should have this form:
[PATHS]
icloud_path = <Path to mounted iCloud folder>
onedrive_path = <Path to mounted OneDrive fodler, if using OneDrive>
sftp_path = <Path for Notability temporary auto-backup on NAS>
sftp_backup_path = <Path for structured backup on NAS>
[SFTP]
sftp_host = <NAS URL or IP address>
sftp_port = <SFTP Port>
sftp_account = <SFTP Account>
sftp_pw = <SFTP Password>Run it in the background or in an Automator app
To have it run on the background, use the following command from terminal :
python3 main.py [-h] [--sftp] [-v] &You can easily set up an Automator app starting AutoMove automatically when logging in by creating a Shell script-executing app, and insert in it the following command :
nohup /usr/local/bin/python3 <path to Python script>/main.py > /dev/null 2>&1 &Just open the Automator app and set it on your device to start at the beginning of a session, et voilà :)
