Hallo allemaal,
Ik heb een map (en daarin submappen) met executable scripts. Deze backup ik naar een ftp-map met behulp van het onderstaande script:
***************************************************************
#!/bin/bash
# Shell script to copy all files recursively and upload them to
# remote FTP server (copy local all directories/tree to remote ftp server)
#
# If you want to use this script in cron then make sure you have
# file pointed by $AUTHFILE (see below) and add lines to it:
# host ftp.mycorp.com
# user myftpuser
# pass mypassword
#
# This is a free shell script under GNU GPL version 2.0 or above
# Copyright (C) 2005 nixCraft
# Feedback/comment/suggestions :
http://cyberciti.biz/fb/# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit
http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
FTP="/usr/bin/ncftpput"
CMD=""
AUTHFILE="/root/.myupload"
if [ -f $AUTHFILE ] ; then
# use the file for auth
CMD="$FTP -m -R -f $AUTHFILE $myf $remotedir $localdir"
else
echo "*** To terminate at any point hit [ CTRL + C ] ***"
myf=ftpmap.isp.nl
myu=inlognaam
myp=wachtwoord
#read -s -p "Enter ftp password : " myp
#echo ""
remotedir="/ubuntu_werk"
localdir="/home/patrick/scripts"
[ "$remotedir" == "" ] && remotedir="/" || :
[ "$localdir" == "" ] && localdir="." || :
CMD="$FTP -m -R -u $myu -p $myp $myf $remotedir $localdir"
fi
$CMD
exit
************************************************************
Als ik echter op een andere pc de backup terug zet dan zijn er sh-files die niet meer executable zijn. (die moet ik dan met de hand weer executable maken)
Hoe kan dat geautomatiseerd?
ps: Als ik chmod a+x *.sh doe dan blijft het commando hangen op een opstaand script (waarvan de owner de root is). Ik ben zelf natuurlijk NIET ingelogd als root.
voorbeeld:
chmod 755 ~/scripts/backup_conky_scripts.sh doet het ook niet. (geen foutmelding)
?