borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.24k stars 744 forks source link

Please add {unixtime} to placeholders #8522

Open sten0 opened 2 weeks ago

sten0 commented 2 weeks ago

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

ISSUE

System information. For client/server mode post info for both machines.

What kind of information?

Your borg version (borg -V).

Borg 1.4.0, and I've searched the master branch for this functionality.

Operating system (distribution) and version.

Debian 12 (Bookworm)

Hardware / network configuration, and filesystems used.

It varies, btrfs for source and ext4 for target (borg repository).

How much data is handled by borg?

Between eight and nine years of backups, which is the longest I've ever stuck with the same backup system. I just rant a "compact" operation and the current stats are:

------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
All archives:                6.00 TB              4.86 TB              1.63 TB

Full borg commandline that lead to the problem (leave away excludes and passwords)

NA

Describe the problem you're observing.

Well, I'm surprised borg doesn't have this feature! As for the practical use, I find it easier to read narrow lines, which is allegedly the case for most people, and {unixtime} is the shortest recognisable way that I know of to insure unique archive names. It also actually means something when it's reversed, unlike pushing something unique through a hash function and then truncating the hash...which would also probably solve the unique archive name problem, although I'd worry about collisions.

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Yes

Solution

int(time.time())

I hope you agree this sounds useful and fun to implement.

ThomasWaldmann commented 2 weeks ago

@sten0 Yeah, should be easy to implement.

Guess we would only have that in borg 1.x though, because borg2 does not require archive names to be unique anymore.

dietmargoldbeck commented 2 weeks ago

@sten0 Yeah, should be easy to implement.

Guess we would only have that in borg 1.x though, because borg2 does not require archive names to be unique anymore.

Please add it to 2.0 also. It improves readability for backup names even when not needed and borg 2.0 should be as compatible to borg 1.4 as possible.

ThomasWaldmann commented 2 weeks ago

Yeah, I can add it to 2.0, no problem.

It's just that it is more convenient with 2.0 to work a bit differently and use the "archive series" way of doing things.

Archives then all have the same name (e.g. "docs" or "home" or "system").

The timestamp, hostname, username are stored in separate metadata and displayed in "borg repo-list". This is much cleaner and has quite some nice effects, because then borg KNOWS what archives belong together: