I need to write a shell script to be scheduled to run daily to backup a directory using mercurial. I have got most of the use cases done except I can figure out a way to do automated login while the script is running.
for REPOSITORY in $@
do
cd $REPOSITORY
# commit the changes
hg commit -A -m "Commit changes `date`"
# push the changes to the remote repository
if hg push
then
logger hg push success
else
logger hg push failure
fi
done
the login prompt is displayed after the hg push command is issued.