Needed backup stript with solution for problem symlinks
Hi everyone from Russia!
I needed to backup data from directories with hyperlinks. All time I was used:
tar cfhFF archive.tar *
i.e. compress all files with hyperlinks follow without "trash" files
But some directories I cannot archive die loop hyperlinks, i.e.:
/somedir -> .
When I try to archive simular directories - tar trying again and again enter to this directory and /somedir/somedir/somedir/somedir/somedir.... etc ...archiving in impossible in this case.
I think this can be solved with scripts that can use readlink to validate loop hperlinks and ignore this. Can you please help me? I does not have any expirience with scripting.
|