O cenário
Eu estou fazendo o backup de uma das máquinas wheezy do Debian via rsnapshot. O diretório de destino é um compartilhamento NFS montado. Um Qnap NAS serve este diretório de destino.
O problema
Mas o rsnapshot reclama sobre algum arquivo já existente, quando ele tenta criar um novo snapshot via cp -al. Não importa se eu uso o cp do gnu-cp ou do rsnapshot:
root@shuttle:~# rsnapshot -v daily
echo 25852 > /var/run/rsnapshot.pid
/bin/rm -rf /mnt/backup/rsnapshot/daily.6/
mv /mnt/backup/rsnapshot/daily.5/ /mnt/backup/rsnapshot/daily.6/
mv /mnt/backup/rsnapshot/daily.4/ /mnt/backup/rsnapshot/daily.5/
mv /mnt/backup/rsnapshot/daily.3/ /mnt/backup/rsnapshot/daily.4/
mv /mnt/backup/rsnapshot/daily.2/ /mnt/backup/rsnapshot/daily.3/
mv /mnt/backup/rsnapshot/daily.1/ /mnt/backup/rsnapshot/daily.2/
native_cp_al("/mnt/backup/rsnapshot/daily.0", \
"/mnt/backup/rsnapshot/daily.1")
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -v daily
----------------------------------------------------------------------------
ERROR: Warning! "/mnt/backup/rsnapshot/daily.1/shuttle/etc/alternatives/Mail.1.gz" exists!
ERROR: Warning! copy_symlink("/mnt/backup/rsnapshot/daily.0/shuttle/etc/alternatives/Mail.1.gz", "/mnt/backup/rsnapshot/daily.1/shuttle/etc/alternatives/Mail.1.gz")
[-- snip! --]
The Twist
A coisa divertida é: O arquivo que está dando rsnapshot (ou cp -al) um tempo difícil realmente existe duas vezes! Olhe para os inodes no começo da linha. Aqui está a saída de ls -li
no meu Debian Box:
lennart@shuttle:~$ ls -li /mnt/backup/rsnapshot/daily.0/shuttle/etc/alternatives/ |grep -i mail
71047301 lrwxrwxrwx 1 root root 23 Oct 28 09:32 mail -> /usr/bin/heirloom-mailx
71047299 lrwxrwxrwx 1 root root 23 Oct 28 09:32 Mail -> /usr/bin/heirloom-mailx
71047302 lrwxrwxrwx 1 root root 39 Oct 28 09:32 mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
71047300 lrwxrwxrwx 1 root root 39 Oct 28 09:32 Mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
71047300 lrwxrwxrwx 1 root root 39 Oct 28 09:32 Mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
71047303 lrwxrwxrwx 1 root root 23 Oct 28 09:32 mailx -> /usr/bin/heirloom-mailx
71047304 lrwxrwxrwx 1 root root 39 Oct 28 09:32 mailx.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
Aqui está o mesmo ls -l1
executado no servidor que está exportando o diretório:
[~] # ls -li /share/backup/rsnapshot/daily.0/shuttle/etc/alternatives/ |grep ->
71047299 lrwxrwxrwx 1 admin administ 23 Oct 28 09:32 Mail -> /usr/bin/heirloom-mailx
71047300 lrwxrwxrwx 1 admin administ 39 Oct 28 09:32 Mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz@
71047301 lrwxrwxrwx 1 admin administ 23 Oct 28 09:32 mail -> /usr/bin/heirloom-mailx
71047302 lrwxrwxrwx 1 admin administ 39 Oct 28 09:32 mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz@
71047303 lrwxrwxrwx 1 admin administ 23 Oct 28 09:32 mailx -> /usr/bin/heirloom-mailx
71047304 lrwxrwxrwx 1 admin administ 39 Oct 28 09:32 mailx.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz@
A questão
Alguém tem alguma idéia do que poderia ter causado isso e como resolvê-lo?
[editar 1]
o mesmo ls de uma máquina executando o OS X 10.9:
thebook-wlan:~ lennart$ ls -li /Volumes/backup/rsnapshot/daily.0/shuttle/etc/alternatives/ |grep -i mail
71047299 lrwxrwxrwx 1 root wheel 23 28 Okt 09:32 Mail -> /usr/bin/heirloom-mailx
71047300 lrwxrwxrwx 1 root wheel 39 28 Okt 09:32 Mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
71047301 lrwxrwxrwx 1 root wheel 23 28 Okt 09:32 mail -> /usr/bin/heirloom-mailx
71047302 lrwxrwxrwx 1 root wheel 39 28 Okt 09:32 mail.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
71047303 lrwxrwxrwx 1 root wheel 23 28 Okt 09:32 mailx -> /usr/bin/heirloom-mailx
71047304 lrwxrwxrwx 1 root wheel 39 28 Okt 09:32 mailx.1.gz -> /usr/share/man/man1/heirloom-mailx.1.gz
Somente a minha caixa Debian parece ter problemas com a listagem de diretórios.