Skip to main content
EDIT: Not using wmctrl
Source Link
    #!/bin/bash
set -e;

ifWELC="Running [RsyncP "$as $USER";

function echo_progress(id)
{
    while (($TRANSFER_SIZE > 1000));    
    do  
        DEST_SIZE=$(du -us $DEST_FOLDER | cut -d / -f 1)"; != 
 "0" ]; then     ((TRANSFER_SIZE=$SOURCE_SIZE-DEST_SIZE)); 
        PROGRESS_PERC=$((DEST_SIZE*100/SOURCE_SIZE));
        echo "Sorry,$PROGRESS_PERC;
 you are not root    sleep 0."1s;
    exitdone;
 1   echo 100;
fi    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 --questionlist --title="RsyncP"title="RsyncP Options" --width=500text="Select rsync options" --text="Sourceseparator='' =--height=470 $SOURCE_FOLDER\nDestination--width=470 =--checklist $DEST_FOLDER\nDo--column you"activate" want--column to"Option" continue?";

if--column ["Description" !FALSE v "Verbose (Terminal only)" FALSE q "Quiet, supress non-derror FILEmessages ]
(Terminal only)" then
FALSE P "Progress (Terminal mkdironly)" -FALSE a "Archive (lrpog)" TRUE r "Recurse into directories" FALSE p $DEST_FOLDER;"Preserve permissions" FALSE o "Preserve owner" FALSE g "Preserve group" FALSE l "Copy symlinks as symlinks");
fi
    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=1;


function echo_progress()
{
   TRANSFER_SIZE=1001;
}

if while[ ("$($TRANSFER_SIZE >id 0)-u);" != "0" 
 ]; then
   do zenity 
 --question --title=RsyncP --text="$WELC, Continue?";
    get_input;
 DEST_SIZE=$(du -s $DEST_FOLDER |rsync cut -d$OPTIONS /$SOURCE_FOLDER -f$DEST_FOLDER 1);& 
     echo_progress | zenity ((TRANSFER_SIZE=$SOURCE_SIZE-DEST_SIZE));-progress 
 --title=RsyncP --no-cancel --auto-close --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" PROGRESS_PERC=$((DEST_SIZE*100/SOURCE_SIZE));
        echo $PROGRESS_PERC;
        sleep 1.5s;
else        
     done;
    wmctrlzenity -r-question "RsyncP"--title=RsyncP -T-text="$WELC, "Done!Continue?";
}    get_input; 
    sudo rsync  -av$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
    #!/bin/bash
set -e;

if [ "$(id -u)" != "0" ]; then
    echo "Sorry, you are not root."
    exit 1
fi

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);

zenity --question --title="RsyncP" --width=500 --text="Source = $SOURCE_FOLDER\nDestination = $DEST_FOLDER\nDo you want to continue?";

if [ ! -d FILE ]
  then
    mkdir -p $DEST_FOLDER;
fi

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=1;


function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
     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 1.5s;
        
     done;
    wmctrl -r "RsyncP" -T "Done!";
}
rsync  -av $SOURCE_FOLDER $DEST_FOLDER & 
echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;
    #!/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
added 211 characters in body
Source Link
    #!/bin/bash
set -e;
SOURCE_FOLDER=$
if [ "$(id -u)" != "0" ]; then
    echo $"Sorry, you are not root."
    exit 1
fi

dirs=$(zenity --entryforms --width=500 --title="Entertitle="RsyncP" Source"--text="Enter source And destination directories" --text=""add-entry="Source: " --add-entry="Destination: " --separator=" ");
     
SOURCE_FOLDER=$(echo $dirs | cut -d' ' -f 1);
DEST_FOLDER=$(echo $($dirs | cut -d' ' -f 2);

zenity --entryquestion --title="RsyncP" --width=500 --title="Entertext="Source Destination"= -$SOURCE_FOLDER\nDestination = $DEST_FOLDER\nDo you want to continue?";

if [ ! -text=""d ));FILE ]
  then
    mkdir -p $DEST_FOLDER;
fi

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=1;
  

function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
        
    done;
    wmctrl -r "RsyncP" -T "Done!";
}
 
rsync  -av $SOURCE_FOLDER $DEST_FOLDER &
  
echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;

I added the following to my .bashrc

alias rsyncp="/path/to/script.sh"

so I only have to type "rsyncp" in a terminal to call it up, and rsync will be verbose in the terminal while the progress bar shows the overall status.

 #!/bin/bash

SOURCE_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Source" --text="" ));
DEST_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Destination" --text="" )); 


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=1;
 
function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
    done;
    wmctrl -r "RsyncP" -T "Done!";
}
 
rsync  -av $SOURCE_FOLDER $DEST_FOLDER &
 
echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;

I added the following to my .bashrc

alias rsyncp="/path/to/script.sh"

so I only have to type "rsyncp" in a terminal to call it up, and rsync will be verbose in the terminal while the progress bar shows the overall status.

    #!/bin/bash
set -e;

if [ "$(id -u)" != "0" ]; then
    echo "Sorry, you are not root."
    exit 1
fi

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);

zenity --question --title="RsyncP" --width=500 --text="Source = $SOURCE_FOLDER\nDestination = $DEST_FOLDER\nDo you want to continue?";

if [ ! -d FILE ]
  then
    mkdir -p $DEST_FOLDER;
fi

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=1;
 

function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
        
    done;
    wmctrl -r "RsyncP" -T "Done!";
}
rsync  -av $SOURCE_FOLDER $DEST_FOLDER & 
echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;
deleted 1 characters in body
Source Link

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

>SOURCE_FOLDER=$SOURCE_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Source" --text="" ));
DEST_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Destination" --text="" )); 


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=1;
 
function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
    done;
    wmctrl -r "RsyncP" -T "Done!";
}

rsync  -av $SOURCE_FOLDER $DEST_FOLDER &

echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;

I added the following to my .bashrc

alias rsyncp="/path/to/script.sh"

so I only have to type "rsyncp" in a terminal to call it up, and rsync will be verbose in the terminal while the progress bar shows the overall status.

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

>SOURCE_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Source" --text="" ));
DEST_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Destination" --text="" )); 


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=1;
 
function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
    done;
    wmctrl -r "RsyncP" -T "Done!";
}

rsync  -av $SOURCE_FOLDER $DEST_FOLDER &

echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;

I added the following to my .bashrc

alias rsyncp="/path/to/script.sh"

so I only have to type "rsyncp" in a terminal to call it up, and rsync will be verbose in the terminal while the progress bar shows the overall status.

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

SOURCE_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Source" --text="" ));
DEST_FOLDER=$(echo $(zenity --entry --width=500 --title="Enter Destination" --text="" )); 


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=1;
 
function echo_progress()
{
    while (($TRANSFER_SIZE > 0));   
    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 1.5s;
    done;
    wmctrl -r "RsyncP" -T "Done!";
}

rsync  -av $SOURCE_FOLDER $DEST_FOLDER &

echo_progress | zenity --progress --title=RsyncP --no-cancel --text="Copying from \n$SOURCE_FOLDER to \n$DEST_FOLDER" ;

I added the following to my .bashrc

alias rsyncp="/path/to/script.sh"

so I only have to type "rsyncp" in a terminal to call it up, and rsync will be verbose in the terminal while the progress bar shows the overall status.

Source Link
Loading