LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy "new files found" on my debain (Server) to windows 7 (Home PC) (https://www.linuxquestions.org/questions/linux-newbie-8/copy-new-files-found-on-my-debain-server-to-windows-7-home-pc-944618/)

Vodkaholic1983 05-12-2012 01:21 PM

Copy "new files found" on my debain (Server) to windows 7 (Home PC)
 
Hi all I have a Debian server and there is one folder (which updates with new folders files etc...) quite alot and am trying to find a way to copy everything from there to my windows 7 pc.

Now I only want it to copy "new items" found and not the same files items etc... everytime (all automatically)

My linux skills are close to zero so am really finding it hard to work this out (if something like this can be done that is)

Thanks alot!
Mike

MS3FGX 05-12-2012 01:33 PM

Sounds like you could mount a shared directory on the Windows machine via Samba, and sync that up with the local directory using rsync.

Vodkaholic1983 05-12-2012 01:35 PM

Quote:

Originally Posted by MS3FGX (Post 4676773)
Sounds like you could mount a shared directory on the Windows machine via Samba, and sync that up with the local directory using rsync.

Oh something else to add (sorry missed this part out) once the files are windows side they will be moved (by me) so will sync still work? (as I need it to remmber what files it moved before so it don#t move them again.

djsoundfx 05-12-2012 03:44 PM

Quote:

Originally Posted by Vodkaholic1983 (Post 4676778)
Oh something else to add (sorry missed this part out) once the files are windows side they will be moved (by me) so will sync still work? (as I need it to remmber what files it moved before so it don#t move them again.

I'm not sure I completely follow this, do you want to push files from your server to your windows box only? (A single direction push could be achieved using samba or even using something simpler like an ftp server or other program on the windows box).

If the files are going to be moved once they're on the your windows machine then you would need to setup a log file and have rsync or another utility check that log file to see what needs to be moved regardless of whether it exists on the client, otherwise tools like rsync just look at the server and client and they make the files on each side match up.

So, why do you want to manually move the files once they're on the windows machine? Are you doing this for the purpose of backup or what're you hoping to accomplish?

Vodkaholic1983 05-12-2012 09:05 PM

Quote:

Originally Posted by djsoundfx (Post 4676850)
I'm not sure I completely follow this, do you want to push files from your server to your windows box only? (A single direction push could be achieved using samba or even using something simpler like an ftp server or other program on the windows box).

If the files are going to be moved once they're on the your windows machine then you would need to setup a log file and have rsync or another utility check that log file to see what needs to be moved regardless of whether it exists on the client, otherwise tools like rsync just look at the server and client and they make the files on each side match up.

So, why do you want to manually move the files once they're on the windows machine? Are you doing this for the purpose of backup or what're you hoping to accomplish?

Hey right
I have a folder on my server which downloads are added

/home/leeching done

I want everything in that folder to be "copyed (only once per file)" to my home pc Q:/leeching done
I want it copyed so that it can still be in seeding state

When its back on my home pc I will be moving them to there right places >>
Hope this makes it easyer to work out what am trying to do :)

Cheers

djsoundfx 05-13-2012 12:08 AM

Got it, so I'd still recommend setting up a samba share (this will initially take some time, effort and research) but samba has a great deal of documentation and there are thousands of tutorials out there. From there you just need a basic little script to run as a cronjob something like
Code:

#!/bin/bash
# First move the logged files (files we know were transferred) to an excludes file
echo /path/to/rsynclog >> /path/to/excludes
# Now perform the actual backup
rsync -v --exclude-from=/path/to/excludes --logfile=/path/to/rsynclog /home/leechingdone /PC(Q:)/leeched

This is very crude but it should give you the idea that you log the files you're moving, then each time before you start to move files you make sure that you're excluding the previously moved files.

djsoundfx 05-13-2012 12:09 AM

Oh and if this runs for long enough you'll have to add some lines to prune the excludes/logfiles from time to time but I doubt that will be an issue for a long time ;)


All times are GMT -5. The time now is 07:47 PM.