Delete only folders older than xx but leave rest?

--min-age only works on files not on directories so this approach won't work :frowning:

Also purge does not obey the filters anyway.

You can use delete + rmdirs but this may not do exactly what you want...

What you really want is to write a script which enumerates the backups you want to keep then excludes those and deletes the rest.

Here are some things which might help

# get a list of the 30 most recent dates
for i in `seq 0 30`; do date +%Y-%m-%d-\* -d "now +$i days" ; done | sort > dirs-to-keep

# list all directories
rclone lsf --dirs-only --dir-slash=false remote ${dest}/old | sort > all-dirs
1 Like