If I understand this correctly, you're looking for a way to make sure that the rsync completes successfully before moving on to the rest of your script. bash would allow you to do this with the '&&' operator (in this case rsync is command1 ):
Code:
command1 && command2
From the bash man page, "command2 is executed if, and only if, command1 returns an exit status of zero."
So, something you might be able to use would be :
Code:
rsync -options file.xx remotehost:/path/to/store && rm file.xx
The gotcha here is that rsync can fail for a couple different reasons and if it does, the second command would not execute.