This script use to transfer file from linux to ftp server. You can automate this file transfer by putting this file in cronjob also.
#!/bin/sh HOST='ftp.users.qwest.net' USER='yourid' PASSWD='yourpw' FILE='file.txt' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE quit END_SCRIPT exit 0
Please note that :
- Using the -n option on the ftp client program to prevent the ftp client from trying to log in immediately. That way, the ftp client does not ask for a user ID and password. No use of /dev/tty.
- Use the ftp client program command quote to send user ID and password to the ftp server.
- 51What is FTP? FTP is an acronym for File Transfer Protocol. As the name suggests,FTP is used to transfer files between computers on a network. It is a standard network protocol based on TCP. FTP is built on a client-server architecture and uses separate control and data connections between the client and the server. FTP (File…
- 39You need to create a shell scrip, needed to call from a crontab, to contact a FTP server and put or get a file. You will need to modify the variable section to reflect your settings. ---------------------------------------- #!/bin/bash HOST=ftp.server.com #This is the FTP servers host or IP address. USER=ftpuser #This is the FTP user that has access to the server. PASS=password #This is the password for the FTP user. # Uses the ftp command with the -inv switches. -i turns off interactive prompting. - Restrains FTP from attempting the auto-login feature. -v enables verbose and progress. ftp -inv $HOST
- 36A Shell script for killing slow MySQL queries: #!/bin/sh # Credentials for a MySQL user with PROCESS, SUPER permissions USERNAME= PASSWORD= # MySQL Server location HOST= PORT=3306 TIMEOUT=60 # 1 minute TARGET_USER= # MySQL user to monitor MYSQL="mysql -u $USERNAME --password=$PASSWORD -h $HOST -P $PORT -B" $MYSQL -N -e 'SHOW…
- 31What is samba server? Samba is an Open Source/Free Software suite that provides file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients. Samba uses the TCP/IP protocol that is installed on the host server.…