Linux.com

Home Learn Linux Linux Answers Internet Need to write a script in a way that all the files in linux should be copied to windows machine
Answers
  • The most natural simple answer for you is use nfs.
    Here are two links that you can read to understand how to use nfs to share files :
    [url]http://support.microsoft.com/kb/324089[/url]
    [url]http://nfs.sourceforge.net/nfs-howto/[/url]
    Once you have nfs set up, your shell script can be as trivial as :
    cp -r /home/anil/shared/somefolder /mnt/nfs/windows/shared/somefolder

    Doing anything more complex than that; such as checksumming or logging will only depend on your shell scripting skills.

    You could use rsync instead of nfs :
    [url]http://www.samba.org/rsync/[/url]
    but if you want the solution that ticks all of your boxes (If your data isn't sensitive, like private information, phone numbers, etc) It's git :
    [url]http://git-scm.com/[/url]
    easy to learn, easy to use, can be scripted, has user interfaces, logs as much as you want, stores everything using hashes to ensure data integrity and much more.
    If your data is sensitive then maybe use nfs or rsync along with strong passwords instead of git.

    There are actually multiple ways to do what you want to do and little short of actually writing the script for you, I'm sure one of the afore mentioned options will suit.

    Answered by Hey! Dojo
    5 years ago
    1 0
  • Having a look on the nature of your question, I would recommend you to have a look on RSYNC. This is a file synchronization tool, which will handle the issue of copying only changed files.
    You can mount the windows partitions (using smbmount/mount -t smbfs) and use rsync from your script in order to keep synchronized the contents of your Linux folders and mounted windows folders. Rsync also provides you with incremental backup facility.

    Answered by Tamas Csaba
    5 years ago
    0 0
  • Take a look at these two solutions:
    - SSHD
    Use an sshd server under windows (Cygwin does it fine), exchange ssh keys between two hosts and simple copy files or dirs by using scp commands

    - RSYNCD
    As well as sshd you can install an RSYNC server daemon, there are a lot of them (free/opensource/shareware/commercial/...). I prefer Cygwin builds in this case also.
    And use RSYNC for dir sync, it works without headaches and it's very powerful

    From these two solution my first bet is RSYNC, it's even portable and cross platform so you can swap your win machine with the operating system of your choice

    Answered by Andrea Benini
    5 years ago
    0 0
  • I would high recommend looking at using rsync because of it's ability to keep the files synchronized, to make this work you will need to install rsync on the windows system using cygwin as outlined at http://www.gaztronics.net/rsync.php

    Answered by mfillpot
    3 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Internet

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board