LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-22-2016, 09:00 AM   #16
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45

Ideally,
I would like to have rsync print me just all the vanished files in a list.
Any idea if I can do that?
Regards
Alex
 
Old 09-22-2016, 09:24 AM   #17
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
You can grep rsync output, like
Code:
rsync ---dry-run <args...> 2>&1 | grep vanished > /tmp/vanished.log

Last edited by keefaz; 09-22-2016 at 09:26 AM.
 
Old 09-30-2016, 04:37 AM   #18
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
rsyncPersonalFiles.sh: line 103: syntax error near unexpected token `2'
rsyncPersonalFiles.sh: line 103: `rsync ---dry-run -Lrav -ev ssh apa@host:/home/myuser/ --exclude ./storage0 --exclude /home/myuser/.cache "$MOUNTPOINT/remoteserver/home/myuser" >2>&1 | grep vanished > /tmp/vanished.log'


this is how I run it
rsync ---dry-run -Lrav -ev ssh apa@remoteserver:/home/myuser/ --exclude ./storage0 --exclude /home/myuser/.cache "$MOUNTPOINT/remoteserver/home/myuser" >2>&1 | grep vanished > /tmp/vanished.log
 
Old 09-30-2016, 04:40 AM   #19
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,003

Rep: Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741Reputation: 5741
>2>&1
you ought to write:
2>&1
the first > is unnecessary
 
Old 09-30-2016, 06:49 AM   #20
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
Before we can concoct something for you, it would be wise if you can let us know what files you want to include (or exclude). For example, all files not ending in .txt but all ending in .c etc.
 
Old 10-03-2016, 10:43 AM   #21
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by pan64 View Post
>2>&1
you ought to write:
2>&1
the first > is unnecessary


now I get
Unexpected remote arg: apa@host:/home/myuser/
rsync error: syntax or usage error (code 1) at main.c(1345) [sender=3.1.0]


perhaps the order of the arguments is not correct.
I am actually try to see which file vanish and see if I can exclude those in advance. that would allow my rsync to run properly
Alex
 
Old 10-03-2016, 11:09 AM   #22
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
You have to re-order rsync args perhaps?
Code:
rsync ---dry-run -Lav \
--exclude ./storage0 \
--exclude /home/myuser/.cache \
apa@remoteserver:/home/myuser/ \
"$MOUNTPOINT/remoteserver/home/myuser" 2>&1 | \
grep vanished > /tmp/vanished.log
Take care to not put spaces after the \
 
  


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
include and exclude in rsync xeon123 Linux - Newbie 4 05-26-2011 11:27 PM
Can we use exclude option in"rm" command to exclude some files/folders? yadav_rk727 Linux - Newbie 1 02-03-2010 10:14 AM
Subversion: exclude certain files or folders Ephracis Linux - Software 1 03-01-2008 03:58 PM
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 01:23 PM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 08:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:23 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