Currently I have an interesting problem to solve:

In short I will need to pull custom text application log files from server windows servers (Mixed environment of windows server 2008 / 2003 sp2 64bit) So that all log files are centralized in one location.

The requirements are:

  • I will need to pull log files from windows servers to a CentOS Linux server.
  • I cannot install additional tools, scripts, and etc on those windows servers to push the files out.
  • I cannot change the applications on windows servers to write log files to another destination.

So current I am using the following methods:

  1. Make log folders on windows servers a shared folder.
  2. Mount those shared folders on CentOS linux server using the commmand: mount -t cifs -o username=windows_username,password=windows_userpassword,domain=windows_domain //windows_server_IP/the_shared_folder /mnt/target_folder

My questions are:

  • How many folders you can mount on a single machine?
  • Although all servers sit in the same network, but how will the performance degrade or how it will impact the Linux server if you mount 100 - 200 folders?

Thanks! :)

  • 1
    Does the log pulling need to happen in parallel? Have you looked at the auto-mounter? That way things are only mounted as needed. Also, I strongly suggest you use a credentials file instead of putting the password on the mount command line. – Zoredache Nov 29 '11 at 4:46

This isn't an answer to your exact question, but in my experience about mounting network filesystems in general (although I don't have up-to-date experience with smbfs on Linux) is that mounting a lot of network file systems can mean deadlocks in case one of the servers goes gown.

I would suggest as an alternative to use a userspace SMB client that doesn't actually mount the filesystem on the server, and just download the files you want, such as smbclient, and then script using that rather than going through the OS's filesystem layer.

  • Love your feedback, I got another question base on your answer. Can I do rsync vie smbclient? – forestclown Nov 29 '11 at 3:59
  • 2
    It's not possible to run rsync over smbclient. You should however consider that running rsync from a mounted remote filesystem won't give you the speedup for altered files you might have been looking for. An alternative, that may or may not be good enough depending on your environment is to check out the features in smbclient itself to use incremental mode for TAR files. This uses the "archive bit" on the remote filesystem to see if a file needs to be archived or not. It's also possible only to backup files newer than a certain other file. A good place to start is the docs for the -T option. – Per von Zweigbergk Nov 29 '11 at 4:08
  • Thanks for the info :) I have read the smbclient doc and it seems like in order to incremental/delta copy I can only use the -T option which will tar the files where I will need to untar them to access the data. I will probably try out rsync from a mounted filesystem. Thanks again :) – forestclown Nov 29 '11 at 4:37

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.