Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm looking for and trying to create some kind of a progress indicator with rsync to help make things a little more obvious at roughly how much time or a rough percentage there is left of the rsync process to copy. I have already kind of created a script that does this however its not at all reliable and it doesn't seem to work either....the script i have at the moment basically looks at the folder and the size of it...then looks at the value of sent bytes in ifconfig for the network interface and then basically divides the folder size by 100 and that gives you an amount of bytes that need to be sent for each percent the process should move up one step. I hope you catch my drift and obviously this is certainly not a great method..most of all i can't get the number of bytes retunrned from 'du' and number of bytes transfered to compare very well..for several reasons.
So i know about --progress but this is not really what i'm looking for ... or it is but --process gives you a progress on a per file basis and i'm looking for a progress on the entire copy basis which i haven't found that rsync can do hence why i'm trying to write my own script to help me with the problem. One other way that might be reasonable would be if i could work out the number of files to be transfered perhaps with rsync in 'dry-run' mode and then somehow count each file rsync has transfered this would give some osrt of indicator...however it would look like the thing has got paused if transferring a very large file so it wouldn't be an even like progress indicator.
Has anyone any ideas..or can rsync give you an over all progress but i've not found it yet??
I've been thinking about the same, but never gotten round to it... I think you are on the right track if you use a dry-run to check out how many files you have to transfer, but to do it well, you'd also have to check the file sizes to calculate this reliably. But still, how reliable does it have to be?
If you use keychain, you could also make a loop to do the files in the list from the dry-run, then you could make a counter AND use Rsync's details as well, but that might be difficult, and present it's own problems.
Thanks for the reply.. yes its almost one of the bigest things i cn say that the rsync protocal lacks in which is a shame, and maybe who knows it might be incorporated into future version. Yea the way i'm going to do it because its reasonably simple is the dry run method..then count the number of files that should have been sent. Then during the transfer have the rsync output to a file and then have a script basically counting the newlines inside the file ...basically meaning the number of files and then getting the percentage this way. Although when tranfering large files its going to look almost like the rsync might have died...i still think this is the best way....it may also be possible to use incorporate the --progress into the rsync and then for each file use the percentange complete of that transfer as a second progress bar then showing...state of transfer of files left as well as enabling the fact you can see if the file currently being transfered is a lage file....therefore not making someone think that perhaps the rsync has crashed.. I think this is the method i will set-up and create when i get round to it...