LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-17-2017, 08:01 AM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Rep: Reputation: Disabled
Rsync syntax help


I need to rsync only .bin files younger than 1 day from folders beginning name with 14. and 11. but also containing sub-folders with different names.

I tried with:
Code:
rsync -Rarv  `find /mnt/NFS_SERVER/ftp/etv/ -type f -mtime -1` --prune-empty-dirs --include "14.*/"  --include="*.bin" --exclude="*" "/mnt/NFS_SERVER/ftp/abc/" "/home/ftp/abc/"
but end up with nothing.
 
Old 02-17-2017, 09:01 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,369

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Have you tried with find?

find <options> | xargs <command to operate on find's output>

sort of thing?
 
Old 02-24-2017, 07:10 AM   #3
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 170

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
Have you tried with find?

find <options> | xargs <command to operate on find's output>

sort of thing?
OK, solved this using:

rsync -dPt --ignore-existing --files-from=/tmp/files.txt /mnt/IP/ftp/source /home/ftp/destination
 
Old 02-25-2017, 04:10 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,369

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Glad you're sorted. I'm not sure if you have to be that specific with rsync, as it transfers nothing if the files are identical and it's very quick. It would only be sensible if yoiu had an awful lot of files.
 
  


Reply



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
[SOLVED] rsync syntax Sefyir Linux - Newbie 7 02-04-2017 11:50 PM
[SOLVED] Rsync With SSH Syntax? NotAComputerGuy Linux - Newbie 2 06-13-2013 04:13 PM
rsync syntax for local copy hoover93 Linux - Software 3 12-21-2012 02:39 AM
Rsync syntax question alexpacio Linux - Software 5 07-23-2007 06:27 PM
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 01:23 PM

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

All times are GMT -5. The time now is 01:42 AM.

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