Container sockets backup

Hi,

i’m backing up my containers data and Duplicacy is skipping two non regular files:

  • postgresql/.s.PGSQL.5432
  • qBittorrent/config/ipc-socket

Is it safe if i skip this files adding a filter? If i’m not wrong these are sockets so there is no need to backup them. Correct?

Would these suffice for ignore all of the kind?

e:\.s.PGSQL.5432$
e:\ipc-socket$

You don’t need to add a filter — these files are already being skipped.

If you want to exclude them still to remove eyesore from logs just do

-postgresql/.s.PGSQL.5432
-qBittorrent/config/ipc-socket

Don’t use regex, because it’s overkill, and if you do — you need to escape the ., otherwise it matches “any symbol”.

That said, backing up storage for the running database may not be what you want to do: if the database is open consistency is not guaranteed, even if you use filesystem snapshots (which require writing pre and post backup scripts on Linux). Instead, you can either gracefully shut down the container running the database before backup and restart after (pre/post backup scripts), or use export facilities provided by the database and backup the exported data, and add database itself to exclusions.

1 Like

Thank you, yes i’m actually turning down the database container before the backup and that’s ok.

For the ipc-socket, i can’t turn the service down. Is it a problem or i can just let Duplicacy skip the file?

Probably not, you can exclude it, or do nothing, and it will continue being skipped.

I’m not sure why are you backing up BitTorrent stuff in the first place. I’d assume you would only want .torrent files, why not just backup that folder?

It’s a container, it’s basically all settings, .torrents. and .fastresume files (required to restore the status of all the torrents). Yes i could exclude something but it’s really small things.

Still not sure why would you want to back that up — restoring old status — what’s the point?

I can understand that they are all small and why bother writing filters if you can backup everything indiscriminately — but the same logic applies to the socket file as well. It’s already being skipped, why bother writing filters?

I’m also surprised that the socket files appear in the container data in the first place. This is supposed to be implementation detail, and stay inside the container. It is menaningkess outside of current session. They should not be writing sockets and other temp data to the containers external volumes. I’m actually surprised it even works. Maybe check that? Perhaps you are accidentally backing up container itself, as opposed to host folders mounted to docker volumes container operates on?

For qBittorrent i backup the whole mounted host folder that contains the settings and the BT_backup folder that contains .torrent and .fastresume files for every torrent i have. Basically without those files i can’t restore the state of the torrents in case of failure. Every torrent has its .torrent and .fastresume files.
Without those files i could yes add the files again but torrent statistics would not be restored.

If i go into the mounted volume i have this:

steakhutzeee@dk:/srv/dev-disk-by-label-HC2/AppData/qbittorrent-nox/config/qBittorrent/config$ ll
total 24
-rwxrw----  1 steakhutzeee users  828 Oct  4 21:28 categories.json
srwx------  1 steakhutzeee users    0 Oct  4 21:29 ipc-socket
-rw-rw----  1 steakhutzeee users    0 Oct  4 21:29 lockfile
-rwxrw----  1 steakhutzeee users  201 Oct 11 11:56 qBittorrent-data.conf
-rw-rw----  1 steakhutzeee users 4817 Oct  5 21:40 qBittorrent.conf
drwxrws---+ 2 steakhutzeee users 4096 Oct  4 21:29 rss
-rw-rw----  1 steakhutzeee users    4 Oct  4 18:41 watched_folders.json

Yeah. It’s a poorly designed container, but you are doing the right thing.

1 Like

Asked to the devs:

1 Like

Ther answer misses the point entirely :).

Well they say it should reside there and can’t do otherwise, no idea why.