Sponsored Content
Top Forums Shell Programming and Scripting How to do ftp from UNIX to windows machine? Post 302802103 by Jotne on Friday 3rd of May 2013 01:15:17 AM
Old 05-03-2013
Here is how I use ftp to send files from unix to windows.
You can store password/username in a file, instead of having it in the script.

Code:
HOST='remote.server.com'
USER='remote'
PASSWD='rpassword'
DATE=$(/bin/date +%Y%m%d)
TIME=$(/bin/date +%H)
HOSTNAME=$(/bin/hostname)

tar zcvfP $DATE.$TIME.$HOSTNAME.tar.gz  /var/bin/*.sh /etc/munin/plugins/* > /dev/null &&
ncftpput -E -u $USER -p $PASSWD $HOST / $DATE.$TIME.$HOSTNAME.tar.gz ;:

rm $(date +%Y%m%d).$(date +%H).$HOSTNAME.tar.gz

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

backup unix files from a windows machine

hello guys , Is there a way to backup unix files from a windows 2003 server i have a tape drive in the unix box but just for extra security what would be the best way to backup unix files . Thanks a lot (7 Replies)
Discussion started by: josramon
7 Replies

2. Windows & DOS: Issues & Discussions

ftp connect from unix to NT machine

I've read some of the threads on here about ftping. It seems most relate to ftp-ing from one unix environment to another. What I'm looking for is a way to ftp files from unix out to an windows NT machine that is connected to a network. If anyone has a simple or complex example, I would sure... (8 Replies)
Discussion started by: anthreedhr
8 Replies

3. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

4. Shell Programming and Scripting

Automatic FTP Script from windows to unix machine

Hi i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files Thanks (2 Replies)
Discussion started by: bmkreddy
2 Replies

5. Shell Programming and Scripting

How to get Windows machine's IP address from Unix?

I am using windows Xp. From windows I would connect to my IBM AIX unix machine using telnet client. Is there any command available to view the IP address of Windows machine from Unix? (Note that ifconfig will give unix mahcine's IP address currently logged in.) (3 Replies)
Discussion started by: mvictorvijayan
3 Replies

6. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

7. Shell Programming and Scripting

UNIX Environment on Windows Machine

Hello World,:cool: Is there a Way to create a UNIX enviornment on Windows bases Machine for enchancing my Skills regarding UNIX scripting.:confused: I know a software name VMware but i dont know how to confiure it:rolleyes:. If this is the apporitate tool for UNIX please guide me the... (3 Replies)
Discussion started by: jojo123
3 Replies

8. UNIX for Dummies Questions & Answers

learning UNIX on a Windows 2000 machine?

What is the best way to learn UNIX, shell, and Perl on a Windows 2000 machine? My place of employment uses Solaris and Perl and I would like to learn some UNIX skills on my home PC. I read about "dual boots", "Microsoft Windows Services for UNIX", and "cygwin". What other free options are... (9 Replies)
Discussion started by: wolfv
9 Replies

9. UNIX for Dummies Questions & Answers

FTP from Windows XP platform to HP-UNIX10.20 machine apllications

Hi Friends Pl. clarify the following. 1. By using ftp hostname we can connect each other as long as within the n/w. Provided user name and password. 2. Using mget****(required files with extension) can trasnsfer all the files(text as well as graphical formats). 3. How we can reproduce the... (2 Replies)
Discussion started by: mohamedfaizyka
2 Replies

10. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies
TRIMHISTORY(8)						      System Manager's Manual						    TRIMHISTORY(8)

NAME
trimhistory - Remove old Xymon history-log entries SYNOPSIS
trimhistory --cutoff=TIME [options] DESCRIPTION
The trimhistory tool is used to purge old entries from the Xymon history logs. These logfiles accumulate information about all status changes that have occurred for any given service, host, or the entire Xymon system, and is used to generate the event- and history-log web- pages. Purging old entries can be done while Xymon is running, since the tool takes care not to commit updates to a file if it changes mid-way through the operation. In that case, the update is aborted and the existing logfile is left untouched. Optionally, this tool will also remove logfiles from hosts that are no longer defined in the Xymon bb-hosts(5) file. As an extension, even logfiles from services can be removed, if the service no longer has a valid status-report logged in the current Xymon status. OPTIONS
--cutoff=TIME This defines the cutoff-time when processing the history logs. Entries dated before this time are discarded. TIME is specified as the number of seconds since the beginning of the Epoch. This is easily generated by the GNU date(1) utility, e.g. the following com- mand will trim history logs of all entries prior to Oct. 1st 2004: trimhistory --cutoff=`date +%s --date="1 Oct 2004"` --outdir=DIRECTORY Normally, files in the BBHIST directory are replaced. This option causes trimhistory to save the shortened history logfiles to another directory, so you can verify that the operation works as intended. The output directory must exist. --drop Causes trimhistory to delete files from hosts that are not listed in the bb-hosts(5) file. --dropsvcs Causes trimhistory to delete files from services that are not currently tracked by Xymon. Normally these files would be left untouched if only the host exists. --droplogs Process the BBHISTLOGS directory also, and delete status-logs from events prior to the cut-off time. Note that this can dramatically increase the processing time, since there are often lots and lots of files to process. --progress[=N] This will cause trimhistory to output a status line for every N history logs or status-log collections it processes, to indicate how far it has progressed. The default setting for N is 100. --env=FILENAME Loads the environment from FILENAME before executing trimhistory. --debug Enable debugging output. FILES
$BBHIST/allevents The eventlog of all events that have happened in Xymon. $BBHIST/HOSTNAME The per-host eventlogs. $BBHIST/HOSTNAME.SERVICE The per-service eventlogs. $BBHISTLOGS/*/* The historical status-logs. ENVIRONMENT VARIABLES
BBHIST The directory holding all history logs. BBHISTLOGS The top-level directory for the historical status-log collections. BBHOSTS The location of the bb-hosts file, holding the list of currently known hosts in Xymon. SEE ALSO
xymon(7), bb-hosts(5) Xymon Version 4.2.3: 4 Feb 2009 TRIMHISTORY(8)
All times are GMT -4. The time now is 05:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy