rsync hanging at "building file list"

Red Squirrel

No Lifer
May 24, 2003
67,549
12,209
126
www.anyf.ca
I have this script I've used for a long time, basically it's just to sync projects from dev to test and test to prod so I can work on it locally then commit changes to test for further testing and then to prod. For some reason, suddently, it started not working. It just hangs at "building file list" for the rsync command.

The rsync command being used is this:

Code:
rsync --checksum --delete-after -rva --exclude-from="${maindir}${envfr}/${proj}/syncexcludes_src.txt" "${maindir}${envfr}/${proj}/src/" "${maindir}${env}/${proj}/src/"

This worked fine like a week ago, it just randomly started doing this. I wanted to make a change to a website but it would not sync so had to SSH to the prod server and do the change manually. Any clues as to what could cause this?

This is the full script:

Code:
#!/bin/sh

maindir="/network/appdev/"

env=$1
envfr=""

if [ "$env" == "test" ] ; then
echo "syncing to test"
envfr="dev"
elif [ "$env" == "prod" ] ; then
echo "syncing to prod"
envfr="test"
else
echo "specify test or prod (environment to sync TO)"
echo "Usage: ./sync.sh [test/prod] [projectname]"
exit
fi

proj=$2

if [ "$proj" == "" ] ; then
echo "You must specify a project folder (and it has to have a src folder in it)"
exit
fi

if [ ! -d "${maindir}${envfr}/${proj}/src/" ] ; then
echo "Project ${proj} does not exist in ${envfr} or src folder not present"
exit
fi

#    File change reason flags
#
#    c -> checksum differs
#    s -> size differs
#    t -> mtime differs
#    p -> permissions differ
#    o -> owners
#    g -> group
#    u -> reserved for future use
#    a -> ACLs
#    x -> extended attributes
#    + -> is new (all +++++'s indicates a new file)
#    . -> is unchanged


echo "checks ok, syncing..."


echo "sync: src"
touch ${maindir}${envfr}/${proj}/syncexcludes_src.txt
mkdir -p "${maindir}${env}/${proj}/src/"

echo
echo "dir of destination:"
dir -ls "${maindir}${env}/${proj}/src/"
echo
echo "-------------------"

echo
echo "--------------------------------------------------------------------------------------------------------------------"
rsync --checksum --delete-after -rva --exclude-from="${maindir}${envfr}/${proj}/syncexcludes_src.txt" "${maindir}${envfr}/${proj}/src/" "${maindir}${env}/${proj}/src/"
echo "--------------------------------------------------------------------------------------------------------------------"
echo
echo "the following files were excluded as per syncexcludes_src.txt:"
echo
cat ${maindir}${envfr}/${proj}/syncexcludes_src.txt
echo


if [ -d "${maindir}${envfr}/${proj}/virdir/" ] ; then
echo "sync: virdirs"
touch ${maindir}${envfr}/${proj}/syncexcludes_virdir.txt
mkdir -p "${maindir}${env}/${proj}/virdir/"
echo
echo "---------------------------------------------------------------------------------------------------------------------"
rsync --checksum --delete-after -rva --exclude-from="${maindir}${envfr}/${proj}/syncexcludes_virdir.txt" "${maindir}${envfr}/${proj}/virdir/" "${maindir}${env}/${proj}/virdir/"
echo "---------------------------------------------------------------------------------------------------------------------"
echo
echo "the following files were excluded as per syncexcludes_virdir.txt:"
echo
cat ${maindir}${envfr}/${proj}/syncexcludes_virdir.txt
echo
echo "----"
fi



echo "Checking for secondary sync file..."
echo

cd ${maindir}${envfr}/${proj}

if [ -f "sync.sh" ] ; then
echo "executing ${proj}'s sync file..."
chmod +x sync.sh
./sync.sh
fi
echo
echo Completed.
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,045
432
126
Could be some form of file or inode corruption that could have occurred. If you get a chance, I would unmount both the source and destination filesystems and do a fsck on both of them. The only other suggestion is to run a trace on the rsync to see if you get more information about when it hangs. Something like "strace -f -ttt your-script-goes-here".
 

Red Squirrel

No Lifer
May 24, 2003
67,549
12,209
126
www.anyf.ca
Hmm funny you mention that since today I was organizing some old files and noticed lot of them were randomly corrupted. I wonder if I have some silent corruption going on. Every now and then my whole network will just grind to a halt and I'll get a lot of kernel errors like "the task delayed for 120 seconds" on my VMs. Switching everything to async mode fixed that but I wonder if I'm getting corruption now instead of lockups. Running mdadm raid which has always been pretty solid but wonder if I should look into ZFS as it has better bit rot protection and other features to avoid corruption.

I need to find something other than NFS for presenting files though, I find I have serious performance issues with NFS and I pretty much gave up trying to figure out why. Setting everything to async did somewhat fix it, but that has a high risk of corruption. Wonder if that's what I'm seeing.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |