5
cp with backup, limit count (discuss.tchncs.de)
submitted 2 months ago by [email protected] to c/[email protected]

If I copy files with backup (cp --backup=numbered), the old file is renamed to something like oldfile.ext.~1~. I get my old files. Can this be limited to a certain number of old files, for example 30? I don't want to have keep more than that...

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 1 points 2 months ago

With cp, I don't think so. But I guess you could try using logrotate for that

this post was submitted on 15 Apr 2025
5 points (100.0% liked)

Linux

1996 readers
1 users here now

Everything about Linux

RULES

founded 2 years ago
MODERATORS