Sponsored Content
Full Discussion: FTP Program
Top Forums Shell Programming and Scripting FTP Program Post 302586039 by rymnd_12345 on Friday 30th of December 2011 03:53:11 AM
Old 12-30-2011
FTP Program

Hi all,

I have a script in 5 servers that looks like this: (collector.sh)
Code:
#!/usr/bin/sh

cat /var/log/messages | grep -i nscmd > nscmd_output
cat /var/log/messages | grep -i sshd | grep -i accepted > sshd_output
sleep 3
cat nscmd_output sshd_output | sort > user_activity
sleep 2
echo
echo "User Logs for Backup-Server:"
echo "----------------------------"
echo
cat user_activity
echo
echo "User History for Backup-Server:"
echo "-------------------------------"
echo
cat .bash_history
echo

The script will collect all the user activity logs from /var/log/messages and as well as the contents of the .bash_history and will put the printed output into /tmp/ directory.

Cat somebody help me how to create a script that will connect to each server through SSH, then execute the script, then get the logs (thru ftp) after the execution of collector.sh, and put all the generated logs from each server under /tmp/ directory of the main server (Server1)

Let's say, the script will be deployed in Server1, so once I executed it, it will first execute the the collector.sh within its self, and then perform the same actions on each server. So that in Server1 /tmp/ directory I have an output of:
Code:
collector_output_server1.log
collector_output_server2.log
collector_output_server3.log
collector_output_server4.log
collector_output_server5.log


Please help and advice,


Best regards,
rymnd_12345
 

10 More Discussions You Might Find Interesting

1. Programming

usage of ftp in C program

thank you of your help my application system is : windows 2000 pc --- HP unix minicom ---- windows NT I am programming with C language on HP unix minicom , I want to get files with ftp command from windows 2000 pc to HP unix minicom in my program, and also put files with ftp command... (1 Reply)
Discussion started by: bdyjm
1 Replies

2. UNIX for Dummies Questions & Answers

ftp program

does anybode know about a ftp program to be run under unix like (for example) ws_ftp.exe and where to get it? Want to run it on a (remote) server... Thanks! (3 Replies)
Discussion started by: paost712
3 Replies

3. UNIX for Dummies Questions & Answers

recommendation please. Unix base ftp program

in win32 platform, i can easily find some GUI based ftp application like cuteFtp, WsFtp and etc which provides GUI + resuming download. pls recommend me some similar application which runs on Sun Solaris sparc 8. hopefully it is free. thank you very much. (1 Reply)
Discussion started by: champion
1 Replies

4. Shell Programming and Scripting

ftp files from Unix to Windows through shell program

Hi, I made a shell script to allow user to ftp file to windows shared drive. Here is part of my code within my shell script: /usr/bin/ftpmtc $usr $pswd $jobno Within 'ftpmtc': #ARGUMENT: USER,PASWD,JOBNO,VER,LOG_DATE,$$ $UCB/echo "user $1 $2" > $inst_file $UCB/echo "cd prod" >> $inst_file... (7 Replies)
Discussion started by: whatisthis
7 Replies

5. Programming

C FTP program

Hi, Can somebody help me with this problem. I was ask to make a C Program that can FTP file file both downloading and uploading file in remote server. How can I do this, or is there any FTP library I can use for this one. I am using HP Unix 11.0 (1 Reply)
Discussion started by: cjediknight
1 Replies

6. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

7. UNIX for Dummies Questions & Answers

Which program can I use for blocking unauthorized access via/ssh/ftp

Hi, I need to install a program on my Centos 5.3 server that will block unauthorized ssh/ftp access attempts. The two features I require is that I should be able to configure the program to block the IP of the intruder after a a certain amount of access attempts and that it should display a... (3 Replies)
Discussion started by: mojoman
3 Replies

8. UNIX for Dummies Questions & Answers

Program: How to FTP logs from a Server to Desktop

Hi guys, Good day! Anyone there could suggest on how can I create a program that will get (ftp) the logs I need from a remote Server (running in Linux) into my Desktop (running in Windows 7). For Perl program suggestions, FYI that I'm using Active Perl version. The reason why I need this one is... (2 Replies)
Discussion started by: rymnd_12345
2 Replies

9. UNIX and Linux Applications

Need a FTP SERVER Program FREE

I need a FTP SERVER program for using in ubuntu, Do you know any for free? ps: there will be no internet connection so, vsftp will not work. need a tool (like filezilla but filezilla has no server version for unix ubuntu) that has to be installation package to extract in it. (6 Replies)
Discussion started by: F@NTOM
6 Replies

10. Shell Programming and Scripting

Perl program get a response before the program quits

I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade. I have: if ( $response =~ m/^/ ) { $user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
BZEXE(1)						      General Commands Manual							  BZEXE(1)

NAME
bzexe - compress executable files in place SYNOPSIS
bzexe [ name ... ] DESCRIPTION
The bzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``bzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
bzip2(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
bzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. BZEXE(1)
All times are GMT -4. The time now is 12:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy