not excluding socket dir?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

not excluding socket dir?

Derek Atkins-2
Hi,

I am trying to backup a mail server but it's complaining about a socket
error..  BUT I thought I was excluding that directory.  The command I'm
using:

/usr/bin/rdiff-backup --exclude /mnt/snap/dev --exclude
/mnt/snap/lost+found --exclude /mnt/snap/media --exclude /mnt/snap/mnt
--exclude /mnt/snap/proc --exclude /mnt/snap/run --exclude /mnt/snap/sys
--include /mnt/snap/var/www --include /mnt/snap/var/spool/imap --include
/mnt/snap/var/spool/mail --include /mnt/snap/var/spool/postfix --include
/mnt/snap/var/spool/rsvp --include /mnt/snap/var/lib/postfix --exclude
/mnt/snap/var/lib/imap/socket --include /mnt/snap/var/lib/imap --include
/mnt/snap/var/lib/squirrelmail --include /mnt/snap/var/spool/cron
--include /mnt/snap/usr/local --exclude /mnt/snap/bin --exclude
/mnt/snap/lib --exclude /mnt/snap/lib64 --exclude /mnt/snap/sbin --exclude
/mnt/snap/tmp --exclude /mnt/snap/usr --exclude /mnt/snap/var
mail_backup::/mnt/snap/ /mnt/backup/backups/mail

And I get this output:

SpecialFileError var/lib/imap/socket/idle.10314 Socket error: AF_UNIX path
too long
SpecialFileError var/lib/imap/socket/idle.10325 Socket error: AF_UNIX path
too long
[snip]

Aren't I excluding the directory properly?

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant


Reply | Threaded
Open this post in threaded view
|

Re: not excluding socket dir?

EricZolf
Hi Derek,

On 08/05/2020 02:31, Derek Atkins wrote:

> Hi,
>
> I am trying to backup a mail server but it's complaining about a socket
> error..  BUT I thought I was excluding that directory.  The command I'm
> using:
>
> /usr/bin/rdiff-backup --exclude /mnt/snap/dev --exclude
> /mnt/snap/lost+found --exclude /mnt/snap/media --exclude /mnt/snap/mnt
> --exclude /mnt/snap/proc --exclude /mnt/snap/run --exclude /mnt/snap/sys
> --include /mnt/snap/var/www --include /mnt/snap/var/spool/imap --include
> /mnt/snap/var/spool/mail --include /mnt/snap/var/spool/postfix --include
> /mnt/snap/var/spool/rsvp --include /mnt/snap/var/lib/postfix --exclude
> /mnt/snap/var/lib/imap/socket --include /mnt/snap/var/lib/imap --include
> /mnt/snap/var/lib/squirrelmail --include /mnt/snap/var/spool/cron
> --include /mnt/snap/usr/local --exclude /mnt/snap/bin --exclude
> /mnt/snap/lib --exclude /mnt/snap/lib64 --exclude /mnt/snap/sbin --exclude
> /mnt/snap/tmp --exclude /mnt/snap/usr --exclude /mnt/snap/var
> mail_backup::/mnt/snap/ /mnt/backup/backups/mail
>
> And I get this output:
>
> SpecialFileError var/lib/imap/socket/idle.10314 Socket error: AF_UNIX path
> too long
> SpecialFileError var/lib/imap/socket/idle.10325 Socket error: AF_UNIX path
> too long
> [snip]
>
> Aren't I excluding the directory properly?
I don't know, I tried to re-create your issue locally, with the attached
script, and I don't get any error message, and the socket file and its
directory I create aren't backed-up:


$ tree /var/tmp/snap
/var/tmp/snap
└── var
    └── lib
        └── imap
            └── socket
                └── idle.12345

4 directories, 1 file


$ tree /var/tmp/backup
/var/tmp/backup
└── backups
    └── mail
        ├── rdiff-backup-data
        │   ├── access_control_lists.2020-05-09T07:36:39+02:00.snapshot
        │   ├── backup.log
        │   ├── chars_to_quote
        │   ├── current_mirror.2020-05-09T07:36:39+02:00.data
        │   ├── error_log.2020-05-09T07:36:39+02:00.data
        │   ├── extended_attributes.2020-05-09T07:36:39+02:00.snapshot.gz
        │   ├── file_statistics.2020-05-09T07:36:39+02:00.data.gz
        │   ├── increments
        │   │   └── var
        │   │       └── lib
        │   ├── mirror_metadata.2020-05-09T07:36:39+02:00.snapshot.gz
        │   ├── session_statistics.2020-05-09T07:36:39+02:00.data
        │   └── special_escapes
        └── var
            └── lib
                └── imap

9 directories, 10 files


This is with 2.0.0 on Fedora 32. Which version(s) are you using on which
OS(s)? There was an issue covered by a test called test_long_socket_name
in testing/longnametest.py. You're actually rather far away from the
limit of 107 characters, but it could still be your issue. Sockets are
IMHO not worth being saved so you could use `--exclude-sockets`.

KR, Eric

rbsocket.sh (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: not excluding socket dir?

Joe Steele-2
Derek:

After running your backup with the exclusion, have you looked in
/mnt/backup/backups/mail/var/lib/imap/ to see if the socket directory
was, in fact, excluded?  My guess is that it is not there.

My guess is that you first made a backup without the '--exclude
/mnt/snap/var/lib/imap/socket' exclusion, and then you added the
exclusion later.  I'm also assuming that you are using v1.2.8.  (Newer
v2.0 should not have the problem.)

The first backup of a socket can succeed without error whereas
subsequent backups can generate the warning whenever the socket is
either changed or removed (or in your case, excluded).  Details for why
this can occur are given in a bug report of mine from 2009:

https://savannah.nongnu.org/bugs/?func=detailitem&item_id=26847

My guess is that the warning will only appear the first time after you
have added the exclusion.  After that, the warning should no longer
appear for the excluded socket.  But if you wish, you can apply the
patch contained in the bug report to prevent the problem in the future.

As Eric noted, there is no real value in backing up sockets.  In fact,
the tar command never backs up sockets.

--Joe


On 5/9/2020 2:01 AM, EricZolf wrote:

> Hi Derek,
>
> On 08/05/2020 02:31, Derek Atkins wrote:
>> Hi,
>>
>> I am trying to backup a mail server but it's complaining about a socket
>> error..  BUT I thought I was excluding that directory.  The command I'm
>> using:
>>
>> /usr/bin/rdiff-backup --exclude /mnt/snap/dev --exclude
>> /mnt/snap/lost+found --exclude /mnt/snap/media --exclude /mnt/snap/mnt
>> --exclude /mnt/snap/proc --exclude /mnt/snap/run --exclude /mnt/snap/sys
>> --include /mnt/snap/var/www --include /mnt/snap/var/spool/imap --include
>> /mnt/snap/var/spool/mail --include /mnt/snap/var/spool/postfix --include
>> /mnt/snap/var/spool/rsvp --include /mnt/snap/var/lib/postfix --exclude
>> /mnt/snap/var/lib/imap/socket --include /mnt/snap/var/lib/imap --include
>> /mnt/snap/var/lib/squirrelmail --include /mnt/snap/var/spool/cron
>> --include /mnt/snap/usr/local --exclude /mnt/snap/bin --exclude
>> /mnt/snap/lib --exclude /mnt/snap/lib64 --exclude /mnt/snap/sbin --exclude
>> /mnt/snap/tmp --exclude /mnt/snap/usr --exclude /mnt/snap/var
>> mail_backup::/mnt/snap/ /mnt/backup/backups/mail
>>
>> And I get this output:
>>
>> SpecialFileError var/lib/imap/socket/idle.10314 Socket error: AF_UNIX path
>> too long
>> SpecialFileError var/lib/imap/socket/idle.10325 Socket error: AF_UNIX path
>> too long
>> [snip]
>>
>> Aren't I excluding the directory properly?
>
> I don't know, I tried to re-create your issue locally, with the attached
> script, and I don't get any error message, and the socket file and its
> directory I create aren't backed-up:
>
>
> $ tree /var/tmp/snap
> /var/tmp/snap
> └── var
>      └── lib
>          └── imap
>              └── socket
>                  └── idle.12345
>
> 4 directories, 1 file
>
>
> $ tree /var/tmp/backup
> /var/tmp/backup
> └── backups
>      └── mail
>          ├── rdiff-backup-data
>          │   ├── access_control_lists.2020-05-09T07:36:39+02:00.snapshot
>          │   ├── backup.log
>          │   ├── chars_to_quote
>          │   ├── current_mirror.2020-05-09T07:36:39+02:00.data
>          │   ├── error_log.2020-05-09T07:36:39+02:00.data
>          │   ├── extended_attributes.2020-05-09T07:36:39+02:00.snapshot.gz
>          │   ├── file_statistics.2020-05-09T07:36:39+02:00.data.gz
>          │   ├── increments
>          │   │   └── var
>          │   │       └── lib
>          │   ├── mirror_metadata.2020-05-09T07:36:39+02:00.snapshot.gz
>          │   ├── session_statistics.2020-05-09T07:36:39+02:00.data
>          │   └── special_escapes
>          └── var
>              └── lib
>                  └── imap
>
> 9 directories, 10 files
>
>
> This is with 2.0.0 on Fedora 32. Which version(s) are you using on which
> OS(s)? There was an issue covered by a test called test_long_socket_name
> in testing/longnametest.py. You're actually rather far away from the
> limit of 107 characters, but it could still be your issue. Sockets are
> IMHO not worth being saved so you could use `--exclude-sockets`.
>
> KR, Eric
>

Reply | Threaded
Open this post in threaded view
|

Re: not excluding socket dir?

Derek Atkins-2
In reply to this post by EricZolf
Hi Eric,

Strangely, I can't reproduce it now, either!  Even more, my nightly backup
is not repeating it.

So consider this closed.

Sorry for the noise.

-derek

On Sat, May 9, 2020 2:01 am, EricZolf wrote:

> Hi Derek,
>
> On 08/05/2020 02:31, Derek Atkins wrote:
>> Hi,
>>
>> I am trying to backup a mail server but it's complaining about a socket
>> error..  BUT I thought I was excluding that directory.  The command I'm
>> using:
>>
>> /usr/bin/rdiff-backup --exclude /mnt/snap/dev --exclude
>> /mnt/snap/lost+found --exclude /mnt/snap/media --exclude /mnt/snap/mnt
>> --exclude /mnt/snap/proc --exclude /mnt/snap/run --exclude /mnt/snap/sys
>> --include /mnt/snap/var/www --include /mnt/snap/var/spool/imap --include
>> /mnt/snap/var/spool/mail --include /mnt/snap/var/spool/postfix --include
>> /mnt/snap/var/spool/rsvp --include /mnt/snap/var/lib/postfix --exclude
>> /mnt/snap/var/lib/imap/socket --include /mnt/snap/var/lib/imap --include
>> /mnt/snap/var/lib/squirrelmail --include /mnt/snap/var/spool/cron
>> --include /mnt/snap/usr/local --exclude /mnt/snap/bin --exclude
>> /mnt/snap/lib --exclude /mnt/snap/lib64 --exclude /mnt/snap/sbin
>> --exclude
>> /mnt/snap/tmp --exclude /mnt/snap/usr --exclude /mnt/snap/var
>> mail_backup::/mnt/snap/ /mnt/backup/backups/mail
>>
>> And I get this output:
>>
>> SpecialFileError var/lib/imap/socket/idle.10314 Socket error: AF_UNIX
>> path
>> too long
>> SpecialFileError var/lib/imap/socket/idle.10325 Socket error: AF_UNIX
>> path
>> too long
>> [snip]
>>
>> Aren't I excluding the directory properly?
>
> I don't know, I tried to re-create your issue locally, with the attached
> script, and I don't get any error message, and the socket file and its
> directory I create aren't backed-up:
>
>
> $ tree /var/tmp/snap
> /var/tmp/snap
> └── var
>     └── lib
>         └── imap
>             └── socket
>                 └── idle.12345
>
> 4 directories, 1 file
>
>
> $ tree /var/tmp/backup
> /var/tmp/backup
> └── backups
>     └── mail
>         ├── rdiff-backup-data
>         │   ├── access_control_lists.2020-05-09T07:36:39+02:00.snapshot
>         │   ├── backup.log
>         │   ├── chars_to_quote
>         │   ├── current_mirror.2020-05-09T07:36:39+02:00.data
>         │   ├── error_log.2020-05-09T07:36:39+02:00.data
>         │   ├── extended_attributes.2020-05-09T07:36:39+02:00.snapshot.gz
>         │   ├── file_statistics.2020-05-09T07:36:39+02:00.data.gz
>         │   ├── increments
>         │   │   └── var
>         │   │       └── lib
>         │   ├── mirror_metadata.2020-05-09T07:36:39+02:00.snapshot.gz
>         │   ├── session_statistics.2020-05-09T07:36:39+02:00.data
>         │   └── special_escapes
>         └── var
>             └── lib
>                 └── imap
>
> 9 directories, 10 files
>
>
> This is with 2.0.0 on Fedora 32. Which version(s) are you using on which
> OS(s)? There was an issue covered by a test called test_long_socket_name
> in testing/longnametest.py. You're actually rather far away from the
> limit of 107 characters, but it could still be your issue. Sockets are
> IMHO not worth being saved so you could use `--exclude-sockets`.
>
> KR, Eric
>


--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant


Reply | Threaded
Open this post in threaded view
|

Re: not excluding socket dir?

Derek Atkins-2
In reply to this post by Joe Steele-2
Hi,

Joe Steele <[hidden email]> writes:

> Derek:
>
> After running your backup with the exclusion, have you looked in
> /mnt/backup/backups/mail/var/lib/imap/ to see if the socket directory
> was, in fact, excluded?  My guess is that it is not there.

Yes, and it is not there..

> My guess is that you first made a backup without the '--exclude
> /mnt/snap/var/lib/imap/socket' exclusion, and then you added the
> exclusion later.  I'm also assuming that you are using v1.2.8.  (Newer
> v2.0 should not have the problem.)

Actually, I think this is probably what happened; I backed up, saw the
error, and then realized I didn't need to backup the socket dir so added
the exclusion, but then I got the error again and sent the email to this
list (not realizing I would get the error that one extra time but no
further).

And yes, this is 1.2.8.  ALL my systems are on 1.2.8.

> The first backup of a socket can succeed without error whereas
> subsequent backups can generate the warning whenever the socket is
> either changed or removed (or in your case, excluded).  Details for
> why this can occur are given in a bug report of mine from 2009:
>
> https://savannah.nongnu.org/bugs/?func=detailitem&item_id=26847

Interesting.

> My guess is that the warning will only appear the first time after you
> have added the exclusion.  After that, the warning should no longer
> appear for the excluded socket.  But if you wish, you can apply the
> patch contained in the bug report to prevent the problem in the
> future.

The warning occurred on the first (or maybe second) backup; only once I
saw the error did I realize it was backing up a socket dir so I excluded
it.

Regardless, it's not backing up the socket dir now, and I'm not getting
the error anymore.  So all is good.

> As Eric noted, there is no real value in backing up sockets.  In fact,
> the tar command never backs up sockets.
>
> --Joe

Indeed -- I had no intension to back it up, but it's not like I went
through the whole file system to find socket subdirs.  One would expect
those to be in /run, not /var/lib ;)

Thanks!

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant