LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2012, 01:21 PM   #1
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Rep: Reputation: 0
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

Last edited by Vodkaholic1983; 05-12-2012 at 01:37 PM.
 
Old 05-12-2012, 01:33 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Sounds like you could mount a shared directory on the Windows machine via Samba, and sync that up with the local directory using rsync.
 
Old 05-12-2012, 01:35 PM   #3
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MS3FGX View Post
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.
 
Old 05-12-2012, 03:44 PM   #4
djsoundfx
Member
 
Registered: May 2008
Distribution: Gentoo, Ubuntu, RHEL, CentOS, BSD, Solaris
Posts: 82

Rep: Reputation: 23
Quote:
Originally Posted by Vodkaholic1983 View Post
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?
 
Old 05-12-2012, 09:05 PM   #5
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by djsoundfx View Post
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
 
Old 05-13-2012, 12:08 AM   #6
djsoundfx
Member
 
Registered: May 2008
Distribution: Gentoo, Ubuntu, RHEL, CentOS, BSD, Solaris
Posts: 82

Rep: Reputation: 23
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.
 
Old 05-13-2012, 12:09 AM   #7
djsoundfx
Member
 
Registered: May 2008
Distribution: Gentoo, Ubuntu, RHEL, CentOS, BSD, Solaris
Posts: 82

Rep: Reputation: 23
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cupsaddsmb "Unable to copy Windows 2000 printer driver files (2)!" molard Linux - Server 4 04-06-2015 09:56 AM
HOW TO FIX ""The requested URL /phpMyAdmin was not found on this server."" amritpalpathak Linux - Software 20 11-06-2012 01:23 AM
Apt update stuck with "A copy of the C library was found in an unexpected directory" exoool Debian 20 10-31-2011 04:33 AM
executing "DOS/Windows executable" files from "/media" Ruarscampbell Linux - Newbie 10 07-05-2011 05:48 PM
"Permission denied" when trying to copy files into mounted windows with all rights twist3r Linux - Newbie 14 05-06-2008 05:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration