[shell script] execute command and parse output
Hi,
I have been trawling the WWW for some time now, trying to find an answer to my problem. I'm writing a shell script (bourne) intended for backing up a database on a remote phpbb bulletin site (ftp access only) and moving the backup to a local machine. Right now I can generate a DB dump on the remote site and ftp it to my local machine using ncftpget. The problem is when I try to parse the output from ncftpget in order to determine how the transfer went. The command is executed like this from within the script : Code:
PS=`/usr/bin/ncftpget -u UserName -p SomePassWord -V www.somesite.com . /store/auto_backup/*.sql.gz` Code:
/usr/bin/ncftpget -u SomeUser -p WrongPass -V www.somesite.com . /store/auto_backup/*.sql.gz I have written other scripts that did not have this problem... I know this may seem like a trivial problem to some, but I have been scratching my head quite a bit trying to figure this one out. Any comments/feedback appreciated! |
Quote:
Code:
PS=$(/usr/bin/ncftpget -u UserName -p SomePassWord -V www.somesite.com . /store/auto_backup/*.sql.gz 2>&1) |
That did the trick! Thank you :)
|
All times are GMT -5. The time now is 09:04 AM. |