Archive for April, 2012
survival – Connection to ftp server using a script and block of commands automatically
April 2, 2012
Leave a comment
It results a bit helpful to send certain information using FTP authenticated, but automatically for scripts, as you can see highlighted.
#!/bin/bash
#
umask 002FTP_Server=”webserver.queiroz.info”
FTP_USER=cqueiroz
FTP_PASSWD=blablablaREMOTE_FTP_DIR=/home/cqueiroz/log_bkp
LOCAL_FTP_DIR=/var/log/app/
cd $LOCAL_FTP_DIR
ftp -inv $FTP_SERVER<<EOF
user $FTP_USER $FTP_PASSWD
binary
cd $REMOTE_FTP_DIR
prompt off
pwd
put *log
bye
EOF
Categories: Uncategorized
Survival – how to remove ^M from a file
April 2, 2012
Leave a comment
There must be many users affected when you use a file edited on Windows and once passed to Linux/Unix is common to find a character at the end of line.
Using vi editor you could fix this inconvenient.
<Esc>:%s/<Ctrl-V><Ctrl-M>//g
Bye for now.
Categories: Uncategorized