Hi,
I have just discovered Rclone and have been working through creating some backups from my headless Ubuntu server to Google Drive. So far, I have managed simple backups but cannot get the syntax right to exclude directories.
In this case, I am trying to exclude the directory “Database” from the backup. I have been testing it using the code:
rclone sync /media/server/server/Management/Database g_storage:Database -v --exclude /media/server/server/Management/Database/Working/ --dry-run
When I run this, the output includes a number of messages like this:
2018/06/25 13:09:35 NOTICE: Working/Costing Sheet/Costing Sheet Estimate Code.txt: Not copying as --dry-run
As I understand it, this means that the files in the directory would be copied if it wasn’t a dry run.
I have tried:
rclone sync /media/server/server/Management/Database g_storage:Database -v --exclude /media/server/server/Management/Database/Working/** --dry-run
But I get the error message:
Command sync needs 2 arguments maximum
Eventually, I would like to run this as a scheduled script reading from an “eclude” list. The script runs the command:
rclone sync /media/server/server/Management/Database g_storage:Database -v --exclude-from /usr/local/sbin/scripts/exclude-list.txt --dry-run
The contents of the exclude list are:
./media/server/server/Management/Database/Working/**
This gives the same output suggesting that the directory and its contents would be copied if it wasn’t a dry run
Can anyone show me where I am going wrong?