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:
| Unit | Suffix | Example | Meaning |
|---|---|---|---|
| Millisecond | ms | 500ms | 0.5 seconds |
| Second | s | 45s | 45 seconds |
| Minute | m | 30m | 30 minutes |
| Hour | h | 6h | 6 hours |
| Day | d | 7d | 7 days |
| Week | w | 2w | 2 weeks |
| Month | M | 1M | 1 month |
| Year | y | 1y | 1 year |
Practical examples:
| Window | Value |
|---|---|
| Last 24 hours | 24h |
| Last 7 days | 7d |
| Last 2 weeks | 2w |
| Last month | 1M |
| Last year | 1y |
Boundary behavior:
--max-age 24hmeans files must be newer than 24 hours.mis minutes, whileMis months.- Use
--dry-run -vvto confirm which files are included/excluded near boundaries.
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 90dselects files with age<= 90 days.- This means files newer than 90 days old (recent files).
- Use
--max-agefor 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
| Flag | Meaning | Selects |
|---|---|---|
--max-age 90d | Age <= 90d | Newer/recent files |
--min-age 90d | Age >= 90d | Older files |
When to Use Max vs Min
- Use
--max-agewhen you want recent files. - Use
--min-agewhen 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