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 08-03-2015, 02:14 AM   #1
rayalab
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Rep: Reputation: Disabled
rsync progress to log file


Hi,

I need to show the progress of rsync in a log file.

If I start rsync manually I can use below command to show the progress in a log file.

/local/rsync --rsync-path=/local/rsync -vt --stats --progress --compress -e /usr/bin/ssh -x -p 22 --partial-dir=/local/partial --block-size=5000 --temp-dir=/local/inbound --timeout=3600 /local/myFiles/file.zip www@www.dev.com:"/local/myFiles/file.zip" >> statusLog.log

Here I san see the status in statusLog.log

The problem is , my rsync command is created from java which will check for every 15 mins for new files. If it finds any new files, then creates a rsync job.

so I have added >> statusLog.log to rsync creation logic in java. but getting below error.

'rsync: link_stat "www@www.dev.com:"/local/myFiles/file.zip"" failed: No such file or directory (2)'
'rsync: link_stat " >> " failed: No such file or directory (2)'
'rsync error: some files could not be transferred (code 23) at main.c(892) [sender=2.6.8]'

what went wrong here?

Can anyone help me to log the progress in log file in this case.

Thanks.

Last edited by rayalab; 08-03-2015 at 02:26 AM.
 
Old 08-03-2015, 02:23 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
I'm not sure that I can help but with this little of a clue as to what the actual question is I know I can't.
 
Old 08-03-2015, 02:49 AM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by rayalab View Post
so I have added >> statusLog.log to rsync creation logic in java. but getting below error.

'rsync: link_stat "www@www.dev.com:"/local/myFiles/file.zip"" failed: No such file or directory (2)'
'rsync: link_stat " >> " failed: No such file or directory (2)'
The Java application tries to access a file called ">>" and fails.

The >> redirector works from the shell, but will not necessarily work when used from inside an application, unless that application happens to be passing the entire argument verbatim to a shell, which is unlikely.

You will need to find another way to append data to a log file. You could try redirecting output from the parent (Java) process, but that might not be ideal if the Java app generates other output to stdout.

How about having the Java app call a shell script, and then start rsync with the appropriate redirection from there?
 
1 members found this post helpful.
Old 08-03-2015, 04:24 AM   #4
rayalab
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks Ser Olmy for your reply.

I will try with your suggestions. Thanks a lot for your quick reply.
 
  


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] About rsync --progress yzT! Linux - Software 4 02-18-2013 01:53 PM
rsync - how to suppress counting files during --process to log output file ? masuch Linux - Newbie 1 09-16-2012 03:20 PM
progress of rsync figure20012 Linux - Newbie 5 08-03-2012 06:30 AM
Need help to have a rsync script log output to a file with time stamp Thaidog Programming 5 11-15-2011 05:37 PM
A progress status for Rsync?? helptonewbie Linux - Newbie 3 03-24-2008 02:05 AM

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

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