# Preserving symbolic links through Samba

## fincoop

Really,

I am looking for an elegant way to back up symbolic links on Gentoo on my Windows machine, where the backup drive is attached. I think, because these attributes are not exported through Samba / Windows wouldn't understand them that this is going to be hard. But, I thought at least that I would ask the pros if there is a way to copy links from Gentoo to Windows and not drag over duplicate copies of the original file.

Alternatively I have tried using tar to capture the directories with the links in them, and then copy the tarball over, and that seems to work, but a bit of a hassle.

TIA

----------

## nyda

I think the tar solution is pretty much the way to go. You could automate it a bit though.

Set up SSH with public key access on your Gentoo box and configure a new user (i.e. "autobackup"). Set the login shell for that user to be a bash script that does the tar-stuff and moves the file to a place you can access via Samba. Install Putty on your windows box and create a key and a profile "autobackup" for autobackup@yourserver. Then add a link to your startmenu/quicklaunch/desktop that launches Putty with the parameters -load "autobackup" to directly log into your Linux Box and start the backup process. Once it's done, just download the file via Samba.

Or... wait for someone with a better idea  :Smile: 

----------

## Hu

If you insist on letting Windows manage the backup drive, then you will have a messy solution, since there is no convenient way to express certain Linux filesystem concepts in NTFS.

I like nyda's idea, but there is no need to create a dedicated user with a special shell for it.  Instead, set the command via the authorized_keys line that authorizes the Windows system to connect.  Also, you might find it useful to use plink instead of putty.  The former is more console-oriented and should be easier to script, once you get a decent scripting language interpreter installed on Windows.

----------

## ppurka

Windows 7 claims to be "compatible" with symbolic links of linux. But that "compatibility" is only half-baked. symbolic links in linux are not interpreted as such in windows. But symbolic links created in win7 are recognized as such in linux (only via ntfs-3g).  So, tar is definitely the best option.

----------

