Skip to main content

rclone --max-age

Max-age is used for recent-change windows where only newly modified content should transfer. This guide covers precise duration syntax and boundary behavior so your hot-sync jobs capture current deltas without dragging in stale historical data.

Syntax

rclone copy SRC DST --max-age 24h

Age Pattern Format

Rclone age filters support these duration suffixes directly:

UnitSuffixExampleMeaning
Millisecondms500ms0.5 seconds
Seconds45s45 seconds
Minutem30m30 minutes
Hourh6h6 hours
Dayd7d7 days
Weekw2w2 weeks
MonthM1M1 month
Yeary1y1 year

Practical examples:

WindowValue
Last 24 hours24h
Last 7 days7d
Last 2 weeks2w
Last month1M
Last year1y

Boundary behavior:

  • --max-age 24h means files must be newer than 24 hours.
  • m is minutes, while M is months.
  • Use --dry-run -vv to confirm which files are included/excluded near boundaries.
Combined duration format

Rclone rejects mixed tokens like 3w3d for age flags. Use a single equivalent duration such as 24d or 576h.

Max-Age Concept (Newer Files)

In rclone, file age means how long ago a file was modified.

  • --max-age 90d selects files with age <= 90 days.
  • This means files newer than 90 days old (recent files).
  • Use --max-age for recent-window sync/copy jobs.

Newer Than Explained

"Newer than 90 days" means modified within the last 90 days.

  • Recent file (age 2d): selected by --max-age 90d
  • Recent file (age 38d): selected by --max-age 90d
  • Old file (age 130d): not selected by --max-age 90d

Quick Comparison

FlagMeaningSelects
--max-age 90dAge <= 90dNewer/recent files
--min-age 90dAge >= 90dOlder files

When to Use Max vs Min

  • Use --max-age when you want recent files.
  • Use --min-age when you want old files.
  • Common pattern: recent backup uses --max-age; old cleanup/archive uses --min-age.

Examples with Output

1. Last 24 hours

Input command:

rclone copy /srv/uploads remote:hot/uploads --max-age 24h --dry-run

Expected output:

NOTICE: max-age filter 24h applied
Would transfer 47 files

2. Last 3 days

Input command:

rclone sync /srv/uploads remote:hot/uploads --max-age 72h --dry-run

Expected output:

NOTICE: recent window 72h
Would copy 63 files, delete 0 files

3. New logs only

Input command:

rclone copy /var/log remote:hot/log --max-age 12h --dry-run

Expected output:

NOTICE: recent logs selected
Would transfer 19 files

4. CI artifacts from this week

Input command:

rclone copy /srv/releases remote:hot/releases --max-age 7d --dry-run

Expected output:

NOTICE: release artifacts newer than 7d
Would transfer 14 files

5. Hot backup window

Input command:

rclone sync /srv/app remote:hot/app --max-age 48h --dry-run

Expected output:

NOTICE: hot backup scope is 48h
Would transfer 85 files

6. Docs changes from last day

Input command:

rclone copy /srv/docs remote:hot/docs --max-age 1d --dry-run

Expected output:

NOTICE: docs changed within 1d selected
Would transfer 23 files

7. With include filters

Input command:

rclone copy /srv/docs remote:hot/docs --max-age 3d --include "**/*.mdx" --dry-run

Expected output:

NOTICE: max-age + include rules active
Would transfer 17 files

8. With checksum mode

Input command:

rclone copy /srv/app remote:hot/app --max-age 2d --checksum --dry-run

Expected output:

NOTICE: checksum comparison enabled
Would transfer 11 changed files

9. With bandwidth cap

Input command:

rclone copy /srv/media remote:hot/media --max-age 18h --bwlimit 20M --dry-run

Expected output:

NOTICE: bwlimit=20M, max-age=18h
Would transfer 28 files

10. Keep transfer size under limit

Input command:

rclone copy /srv/data remote:hot/data --max-age 36h --max-size 200M --dry-run

Expected output:

NOTICE: max-age and max-size constraints met
Would transfer 51 files

11. Recent uploads only

Input command:

rclone sync /srv/www/wp-content/uploads remote:hot/uploads --max-age 5d --dry-run

Expected output:

NOTICE: upload delta window 5d
Would transfer 142 files

12. Verbose validation

Input command:

rclone copy /srv/site remote:hot/site --max-age 8h --dry-run -vv

Expected output:

DEBUG: Excluded (too old): assets/logo-old.png
INFO : 1 age filter rule active

13. Fast incremental sync

Input command:

rclone sync /srv/reports remote:hot/reports --max-age 2d --checkers 10 --transfers 5 --dry-run

Expected output:

NOTICE: checkers=10 transfers=5
Would transfer 34 files

14. Recent DB dump export

Input command:

rclone copy /srv/db-dumps remote:hot/db --max-age 30h --include "**/*.sql.gz" --dry-run

Expected output:

NOTICE: recent sql.gz dumps selected
Would transfer 6 files

15. Production-safe dry run

Input command:

rclone sync /srv/app remote:hot/app --max-age 24h --dry-run -vv

Expected output:

NOTICE: dry-run enabled, no data changed
Would transfer 46 files