Might be a bit late here but future answer-seekers might benefit.
This was bugging me too so I thought I'd get down and dirty and write my first script. The package zenity must be installed (sudo apt-get install zenity), but I'm sure it will probably be there already. Also, I use wmctrl (window manager control) to change the title of the progress dialog when it's done, it's easily installable but won't make a difference if you don't. I just like to see when it's done in my panel.
The script basically asks for a source and destination directory, calculates the percentage of the destination over the source in size using du and displays a progress bar.
Note: This only works for complete directory/file syncing (I usually use it to make backups of apt cache), so no --exclude=/file/in/Source-directory option.
Also won't work if there are files/directories in Destination directory not in the source directory.
I'm not sure if it works for remote sources/destinations since never I've had the need for it or the resources to test it.
PS. This script might be very badly written or very inefficient, (script-virgin here), but at least it serves it's purpose and of course you're welcome to edit and improve it to suit your needs.
PSS. Also, couldn't get the cancel button to kill rsync so I just removed it.
#!/bin/bash
set -e;
WELC="Running RsyncP as $USER";
function echo_progress()
{
while (($TRANSFER_SIZE > 1000));
do
DEST_SIZE=$(du -s $DEST_FOLDER | cut -d / -f 1);
((TRANSFER_SIZE=$SOURCE_SIZE-DEST_SIZE));
PROGRESS_PERC=$((DEST_SIZE*100/SOURCE_SIZE));
echo $PROGRESS_PERC;
sleep 0.1s;
done;
echo 100;
zenity --info --width=250 --title=RsyncP --text="File syncing complete!";
}
function get_input()
{
dirs=$(zenity --forms --width=500 --title="RsyncP" --text="Enter source And destination directories" --add-entry="Source: " --add-entry="Destination: " --separator=" ");
SOURCE_FOLDER=$(echo $dirs | cut -d' ' -f 1);
DEST_FOLDER=$(echo $dirs | cut -d' ' -f 2);
OPTIONS=-$(zenity --list --title="RsyncP Options" --text="Select rsync options" --separator='' --height=470 --width=470 --checklist --column "activate" --column "Option" --column "Description" FALSE v "Verbose (Terminal only)" FALSE q "Quiet, supress non-error messages (Terminal only)" FALSE P "Progress (Terminal only)" FALSE a "Archive (lrpog)" TRUE r "Recurse into directories" FALSE p "Preserve permissions" FALSE o "Preserve owner" FALSE g "Preserve group" FALSE l "Copy symlinks as symlinks");
zenity --question --no-wrap --title="RsyncP" --width=500 --text="rsync $OPTIONS $SOURCE_FOLDER $DEST_FOLDER\nDo you want to continue?";
SOURCE_SIZE=$(du -s $SOURCE_FOLDER | cut -d / -f 1);
DEST_SIZE=$(du -s $DEST_FOLDER | cut -d / -f 1);
PROGRESS_PERC=$((DEST_SIZE*100/SOURCE_SIZE));
TRANSFER_SIZE=1001;
}
if [ "$(id -u)" != "0" ]; then
zenity --question --title=RsyncP --text="$WELC, Continue?";
get_input;
rsync $OPTIONS $SOURCE_FOLDER $DEST_FOLDER &
echo_progress | zenity --progress --title=RsyncP --no-cancel --auto-close --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;
else
zenity --question --title=RsyncP --text="$WELC, Continue?";
get_input;
sudo rsync $OPTIONS $SOURCE_FOLDER $DEST_FOLDER &
echo_progress | zenity --progress --title=RsyncP --no-cancel --auto-close --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;
fi