FTP'ing via a .sh, can you log what happens?
I have a .sh that does some FTP'ing for us, a modified version of it at the bottom.
The script runs very early in the morning, and sometimes doesn't work. Is there an option or something I can add in somewhere to where it'll log what it does or any errors it gets? I'd just like it to maybe write to a file i could read in the morning at a reasonable hour, then it would just overwrite that file every day, so i dont end up with some massive log file since i'd only really need to see the info from the night before. ftp -n -i 1.2.3.4 << EOF user username password bin cd /dir1/ lcd /stuff/to/upload/ put *.txt mput *.jpg lcd /more/stuff/to/upload/ put *.txt mput *.jpg close quit EOF |
Quote:
Code:
set cmd:trace yes |
thanks unSpawn, maybe someone will know for just the regular ftp as well.
|
Well, if it generates an error msg, it should go to stdout/stderr, so just capture those
Code:
myftpcmds.sh >myftpcmds.log 2>&1 |
Thanks Chris. i'll give that a shot.
i've seen that at the top of other .sh's before but never knew what it was for. |
Well, http://ss64.com/bash/set.html but in short those 2 options show you what the parser is seeing/doing ie before & after versions of the cmds.
|
All times are GMT -5. The time now is 11:18 PM. |