Mr.PlanB Logo

    Newsletter

    Subscribe our newsletter

    Get new infrastructure guides, comparison reports, and migration notes in your inbox.

    Infrastructure notes, guides, and new tools. Unsubscribe anytime.

    Back to Blog
    Backup
    rclone
    Cloud Storage
    Homelab

    rclone sync to Google Drive: 3 flags that stop one bad run from wiping your backup

    December 2, 2026
    6 min read

    rclone sync to Google Drive will delete your backup copy if the source folder is empty or broken when the job runs, because sync makes the destination match the source. The fix is one flag: add --backup-dir with a dated folder on the same remote, so anything sync would delete or overwrite is moved aside instead. --max-delete is a useful tripwire on top, but in my test it still let one file go.

    This came up on X this week. Someone backs up a homelab to Google Drive with rclone, and it is a very common setup: a free plan, a cron line, and a rclone sync that nobody reads again. I wanted to see what the usual safety flags really do when the job meets an empty source.

    Does rclone sync delete files on Google Drive?

    Yes. The rclone docs describe sync as making the destination identical to the source, and they warn that it can cause data loss, so you should test first with --dry-run or --interactive. A missing file in the source becomes a delete on the remote.

    Two things soften this on Google Drive. The rclone Drive backend has use_trash set to true by default, so deleted files go to the Drive trash instead of being removed at once. That is a second safety net, but I would not build a plan on it: the files are out of your backup folder, mixed in with whatever else is in the trash, and you have to notice in time.

    The other is that Drive storage is small on a free account. Google says each Google Account includes up to 15 GB, shared across Gmail, Google Drive and Google Photos. If you are picking where these copies live, I compared the free cloud storage plans people use for this.

    What I tested

    rclone v1.75.1 on a Mac, on 2 Dec 2026. I used local folders standing in for the Drive remote, so no cloud account was involved; the sync logic is the same. Before each case I synced 3 files to dst/current, then emptied the source folder, the way a script error or an unmounted disk would.

    $ rclone sync src dst/current --dry-run
    NOTICE: b.conf: Skipped delete as --dry-run is set (size 5)
    NOTICE: a.conf: Skipped delete as --dry-run is set (size 5)
    NOTICE: c.conf: Skipped delete as --dry-run is set (size 5)
    files still in dst/current: a.conf b.conf c.conf
    
    $ rclone sync src dst/current --max-delete 1
    exit code: 7
    ERROR : b.conf: Got fatal error on delete: --max-delete threshold reached
    ERROR : a.conf: Got fatal error on delete: --max-delete threshold reached
    files still in dst/current: a.conf b.conf
    
    $ rclone sync src dst/current --backup-dir dst/old/2026-12-02
    exit code: 0
    dst/current:
    dst/old/2026-12-02: a.conf b.conf c.conf
    
    $ rclone copy dst/old/2026-12-02 src
    src: a.conf b.conf c.conf
    

    --dry-run listed all 3 deletes and changed nothing. That is the right first step for a new job, and useless for a job that already runs from cron.

    --max-delete 1 deleted c.conf, then hit the limit and stopped with a fatal error and exit code 7. So it limits the damage. It does not prevent it.

    --backup-dir let the sync empty current completely, and all 3 files were sitting in old/2026-12-02. One rclone copy brought them back.

    What does --backup-dir do?

    The docs put it simply: with sync, copy or move, any file that would be overwritten or deleted is moved, in its original folder layout, into the backup directory. It covers both cases you care about: the file deleted by an empty source, and the good file overwritten by a corrupted or encrypted one.

    There are three rules from the docs:

    • The backup directory must be on the same remote as the destination.
    • It must not overlap the destination folder unless a filter rule excludes it. gdrive:backup/current and gdrive:backup/old are fine; gdrive:backup and gdrive:backup/old are not.
    • The remote must support server-side move or copy, which is what keeps this cheap: the files are moved on the Drive side, not uploaded again.

    Use a dated folder so one bad night does not overwrite the previous one:

    rclone sync /srv/backup gdrive:backup/current \
      --backup-dir gdrive:backup/old/$(date +%F) \
      --max-delete 50
    

    The old folders will grow, so prune them now and then, after you have checked that current looks right.

    Is --max-delete enough?

    I keep it, but as a tripwire. When it trips, rclone stops with a fatal error, and my test got exit code 7, so a wrapper script or a monitoring check can catch the failed run and tell you. Set N above the number of files you normally delete in a day and well below the size of the whole backup. There is also --max-delete-size, which stops on the total size of deletions instead of the count.

    On its own it still costs you files: whatever was deleted before the limit is gone from the backup folder. With --backup-dir next to it, those files are in the dated folder too.

    rclone copy or rclone sync?

    If you do not need deletions mirrored, use rclone copy. It never deletes on the destination, so an empty source does nothing. The cost is that the remote keeps everything you ever removed locally, which eats a 15 GB free plan quickly.

    If you use sync, I would not run it on a schedule without --backup-dir. That is my one firm opinion here. The flag costs nothing to add, and it turns the worst case from "the backup is gone" into "restore from last night's folder".

    A last Drive detail from the rclone docs: there is an undocumented limit of about 750 GiB of uploads a day. A home backup will rarely hit it, but a first full upload of a large media library can. --drive-stop-on-upload-limit makes rclone stop with a fatal error instead of retrying.

    None of this replaces a second copy somewhere else. Drive is one off-site copy; the 3-2-1 backup rule still applies, and a restore you have actually run is worth more than any flag.

    If you want someone to read your backup setup and tell you where a bad run or a ransomware hit would hurt, I do a written second opinion.

    Sources

    Frequently Asked Questions

    Does rclone sync delete files on Google Drive?

    Yes. rclone sync makes the destination identical to the source, so a file that is missing from the source is deleted on the Drive side. By default rclone sends those files to the Drive trash (use_trash defaults to true), but the files are gone from the backup folder.

    What does --backup-dir do in rclone?

    Any file that sync, copy or move would overwrite or delete is moved into the backup directory in its original folder layout instead. It must be on the same remote as the destination and must not overlap the destination folder unless a filter rule excludes it.

    Is --max-delete enough to protect an rclone backup?

    No. In my test with --max-delete 1, rclone deleted one file before it stopped with a fatal error and exit code 7. It limits the damage and gives your script an error to catch, but it does not keep every file.

    Should I use rclone copy or rclone sync for backups?

    rclone copy never deletes on the destination, so it is the safer default when you do not need deletions mirrored. If you use sync, add --backup-dir so that deleted and overwritten files are moved aside rather than lost.