I'm using smbclient to access a shared Windows file system. I cannot mount it, because I don't have the permissions.

How do I mget only the files which are new or have been updated? (Likewise mput).

I don't think I can use rsync, because rsync only works if one mounts the Windows FS, which I can't do. I can only access it via smbclient.


You can use the archive bit (assuming no one else is fiddling with the archive bits on the files you're interested in).

Windows sets the bit whenever a file is created or modified.

smb: \> archive 2

Will tell SMB only to operate on files that have that bit set, and to reset it to zero when done.

So this will help with mget. For mput you want the opposite -- and the serverside archive bit won't help you see which of your own files has been modified, so this solution only works for mget.

This activity (getting only changed files and resetting their archive bits) is common enough to have its own command line option as well. See the -T or --tar option with the c (create) and g (incremental) flags.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.