Sync directories without too much overhead I want to have a cloud-backup of my Documents directory; however, I'm not too fond of the idea of uploading the Documents in an unencrypted fashion. That's why I looked into the Cryptomator app. I do really like the idea of having a cloud-backup while still being sure that my documents are not analyzed by any storage provider.
The general approach would be to move the documents folder to the mountable Cryptomator drive and to save everything directly to this mounted drive. As I cannot be totally sure that Cryptomator will never end their service, and I also cannot be sure that there will never be any decryption issues, I don't like the idea of only having encrypted versions of my documents.
Hence, my optimal solution would be to keep my local Documents directory and sync it to the mounted Cryptomator drive, which will then upload the encrypted documents to my cloud storage. If a problem arises, I will still have access to the local copy; if not, great, I'll now be able to access my documents wherever I am, without fearing that any third-party can read my documents.
How should I go about the syncing of the directory? Can I do this with the functions present on macOS, or do I have to install additional software? Do you think that my plan is well thought out?
cron + rsync
Use rsync to sync the folders, and cron to schedule the backups. You can open up your cron table (list of scheduled commands) with crontab -e. First you can create your backup with:
rsync -a ~/Documents &lt;backup folder path&gt;

This will create a backup named &quot;Documents&quot; in the directory you specify. Then you can schedule this command to run at certain times with cron. For example:
0 12 * * * rsync -a ~/Documents &lt;backup folder path&gt;

This will backup your Documents folder to the backup folder path every day at noon. The format is:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * &lt;command to execute&gt;

An asterisk means the task will run for every value of that time interval. So leaving all the asterisks would make it run every minute of every hour of every day of every month for every day of the week. In the example command I wrote earlier it would run at minute 0 of hour 12 (noon) of every day of every month for every day of the week.
It detects and updates only the edited, deleted, or added files so it will be very fast once you have already backed up the folder once.