Skip to main content

rclone --min-age

Min-age is designed for older-than selection windows, making it useful for archival offloads and delayed backup tiers. This guide explains exact duration behavior and practical combinations so you can move mature data without touching fresh, still-changing files.

Syntax

rclone copy SRC DST --min-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
Older than 24 hours24h
Older than 7 days7d
Older than 2 weeks2w
Older than 1 month1M
Older than 1 year1y

Boundary behavior:

  • --min-age 24h means files must be older than 24 hours.
  • m is minutes, while M is months.
  • Usually pair with --dry-run -vv to verify boundary matches before production.
Combined duration format

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

Min-Age Concept (Older Files)

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

  • --min-age 90d selects files with age >= 90 days.
  • This means files older than 90 days.
  • Use --min-age when your goal is cleanup, retention delete, or cold archive moves.

Quick Comparison

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

Delete Older Than 90 Days

If your goal is deleting files older than 90 days, use --min-age 90d.

safe-delete-old-files.sh
# dry run first (recommended)
rclone delete remote:path --min-age 90d --dry-run

# actual delete
rclone delete remote:path --min-age 90d

Examples with Output

1. Older than 24 hours

Input command:

rclone copy /srv/uploads remote:archive/uploads --min-age 24h --dry-run

Expected output:

NOTICE: min-age filter 24h applied
Would transfer 138 files

2. Older than 7 days

Input command:

rclone sync /srv/logs remote:archive/logs --min-age 7d --dry-run

Expected output:

NOTICE: only files older than 7d selected
Would transfer 64 files

3. Cold media archive

Input command:

rclone copy /srv/media remote:cold/media --min-age 30d --dry-run

Expected output:

NOTICE: cold-tier selection enabled (30d)
Would transfer 412 files

4. Database dumps older than 3 days

Input command:

rclone copy /srv/db-dumps remote:archive/db --min-age 72h --dry-run

Expected output:

NOTICE: min-age 72h matched
Would transfer 22 files

5. Keep recent files out

Input command:

rclone copy /srv/app remote:backup/app --min-age 2d --exclude "**/*.tmp" --dry-run

Expected output:

NOTICE: min-age and exclude rules active
Would transfer 79 files

6. Weekly compliance archive

Input command:

rclone copy /srv/audit remote:archive/audit --min-age 14d --dry-run

Expected output:

NOTICE: selected records older than 14d
Would transfer 56 files

7. With checksum comparison

Input command:

rclone copy /srv/releases remote:archive/releases --min-age 5d --checksum --dry-run

Expected output:

NOTICE: checksum mode enabled
Would transfer 17 changed files

8. With bandwidth limit

Input command:

rclone copy /srv/videos remote:archive/videos --min-age 10d --bwlimit 12M --dry-run

Expected output:

NOTICE: bwlimit=12M, min-age=10d
Would transfer 93 files

9. With transfer parallelism

Input command:

rclone copy /srv/data remote:archive/data --min-age 48h --transfers 4 --checkers 8 --dry-run

Expected output:

NOTICE: checkers=8 transfers=4
Would transfer 141 files

10. Combine min-age and min-size

Input command:

rclone copy /srv/media remote:cold/media --min-age 30d --min-size 500M --dry-run

Expected output:

NOTICE: min-age=30d and min-size=500M
Would transfer 39 files

11. Sync old static assets

Input command:

rclone sync /srv/site remote:archive/site --min-age 21d --dry-run

Expected output:

NOTICE: static files older than 21d selected
Would copy 67 files, delete 0 files

12. Verbose rule verification

Input command:

rclone copy /srv/docs remote:archive/docs --min-age 36h --dry-run -vv

Expected output:

DEBUG: Excluded (too new): handbook/new-page.mdx
INFO : 1 age filter rule active

13. Incremental cleanup export

Input command:

rclone copy /var/log remote:archive/log --min-age 3d --max-size 200M --dry-run

Expected output:

NOTICE: selected old logs under 200M
Would transfer 74 files

14. Monthly old report offload

Input command:

rclone copy /srv/reports remote:cold/reports --min-age 60d --dry-run

Expected output:

NOTICE: report offload window 60d
Would transfer 31 files

15. Safe run before production

Input command:

rclone sync /srv/app remote:archive/app --min-age 7d --dry-run -vv

Expected output:

NOTICE: dry-run enabled, no writes performed
Would transfer 95 files