Archive

Archive for April, 2012

survival – Connection to ftp server using a script and block of commands automatically

It results a bit helpful to send certain information using FTP authenticated, but automatically for scripts, as you can see highlighted.

#!/bin/bash
#
umask 002

FTP_Server=”webserver.queiroz.info”
FTP_USER=cqueiroz
FTP_PASSWD=blablabla

REMOTE_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

Read more…

Categories: Uncategorized

Survival – how to remove ^M from a file

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