Sponsored Content
Top Forums Shell Programming and Scripting shell script to copy files frm a linux machine to a windows machine using SCP Post 302540188 by nithin6034 on Wednesday 20th of July 2011 01:40:17 AM
Old 07-20-2011
I need a script for this. Let me clear the things in detail.

I have a linux machine, where the file gets changing everyday (new files will be updated everyday). I want to copy the most latest file to the windows server.

I can use scp for this.

scp -r [/path/filename] [login name@ip address] : .

Here the filename gets changing everyday and I want to copy the files to a specific folder in Windows. How to do this using a script which automatically does this on a daily basis???

Seek ur help to solve this..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how can i copy data in LINUX Machine to windows XP

Can anyone tell me how can i copy data in LINUX Machine to windows XP Thanks, Sandeep (2 Replies)
Discussion started by: bsandeep_80
2 Replies

2. UNIX for Dummies Questions & Answers

Copy file from Remote Unix box to windows machine

Hi I need to copy a file from the remote unix server to windows machine. I read lot of thrad but didn't worked out. Requesting all to please help. (2 Replies)
Discussion started by: sameerspice
2 Replies

3. Solaris

Best possible communication mechanism between a Solaris machine and a windows machine

hi, I have some windows client machines which require a signal to be sent by a Solaris machine( SunOS 5.6) when ever a particular event occurs on that Solaris machine. What are possible communication mechanisms by which i can do this. the constraints are > the windows machines have to... (7 Replies)
Discussion started by: Krsh
7 Replies

4. Shell Programming and Scripting

SSH into a linux machine from a windows machine

I basically want to login into different linux machines( on the same network) from a windows machine. I know i can use ssh <machine name>. But i want to automate this process. I dont want to enter the username and password. Is there any way to do it. Can i make some sort of a batch script for it. (4 Replies)
Discussion started by: lassimanji
4 Replies

5. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

6. UNIX for Dummies Questions & Answers

Cross complie linux make files onto a windows 7 machine using PGI Cygwin

Hello, I am very unfamiliar with linux/unix (don't even know the difference), but am trying to get some linux software to run on my Windows machine for my research. I have the makefiles for the software, and it is designed to be compiled in the PGI complier, which I also have. When i... (6 Replies)
Discussion started by: roba87
6 Replies

7. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

8. Shell Programming and Scripting

Running remote system shell script and c binary file from windows machine using java

Hi, I have an shell script program in a remote linux machine which will do some specific monitoring functionality. Also, have some C executables in that machine. From a windows machine, I want to run the shell script program (If possible using java). I tried with SSH for this. but, in... (1 Reply)
Discussion started by: ram.sj
1 Replies

9. Solaris

how to execute shell script present in unix machine remotely from windows

how to execute shell script present in unix machine remotely from windows? I having a shell script in my unix machine, need to execute the script remotely from my windows machine using Visual Basic or VBA macros. Thanks In Advance. --Suresh (1 Reply)
Discussion started by: sureshmani
1 Replies

10. UNIX for Dummies Questions & Answers

Copy files from Linux server local windows machine using a shell script

Hello, I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine. Is this possible.? Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies
DUPLOAD.CONF(5)                                                   Debian Project                                                   DUPLOAD.CONF(5)

NAME
dupload.conf - configuration file for dupload DESCRIPTION
The configuration file is rather straight forward Perl code as it's included by the dupload script via "do $config". The config file is read as Perl code! Any dupload.conf must begin with "package config;" because "config" is the namespace expected by dupload. For examples of the configuration please refer to the global configuration file /etc/dupload.conf. It contains associative arrays, each indexed by the nickname (see --to option of dupload), for the following items: fqdn [required] The fully qualified domain name (FQDN) of the nickname. method [optional] The transfer method. The available methods are: "ftp" (which is the default), "scp", "scpb" and "rsync" (over SSH). If you are using an upload queue, use FTP because it's fast. If you are using an authenticated host, always use scp or rsync via SSH, because FTP transmits the password in clear text. For scp and rsync to work properly, you have to setup the remote and local host to establish a ssh/slogin connection using .shosts/.rhosts or the files in ~/.ssh/. If you don't want or can't do that, you may find the scpb more convenient since it uploads in batch, reducing the number of password prompts. The only major caveat of the rsync and scpb options is that the files are processed in a batch mode, i.e. not separately, so in case of an error dupload won't be able to detect which part of the transfer failed, and just delete the .upload file completely. login [optional] The account name used to log into the FTP server. The default is "anonymous", should work with firewall logins too. incoming [required] Incoming directory, the directory we try to upload to. queuedir [optional] The directory we move the uploaded files to (after successful upload to incoming. Usually necessary only with some special upload queues. mailto [optional] Email address where the announcement about stable packages is sent. mailtx [optional] Email address where the announcement about unstable and experimental packages is sent. cc [optional] Email address where to send a copy address of the announcement. fullname [optional] Your full name, one that should appear in the announcement; If you leave this setting empty, the default will depend on your mail system. Usually the full name will be copied from the GCOS field in /etc/passwd. visibleuser [optional] Your username that should appear in the announcement. Defaults to "getlogin()". visiblename [optional] The host/domain name that appears as the part to the right of the @ character in the from-part of the announcement. Defaults to the value your local MTA likes. passive [optional] Set the passive mode for FTP transfers. Since dupload uses Net::FTP, you can also use the environment variable FTP_PASSIVE. options [optional] String that will be added verbatim to the command line of any scp or rsync calls done. dinstall_runs [optional] Tells dupload that the remote host runs dinstall (or equivalent) so that dupload won't send a duplicate announcement mail. The default is 0 (false), set it to 1 to enable it. nonus [optional] Tells dupload that the remote host is a valid destination for packages with non-US in their Section field, so that dupload doesn't warn about it. The default is 0 (false), set it to 1 to enable it. archive [optional] If set to 0 (false), adds a "X-No-Archive: yes" header in the announcement. The default is 1 (true). The configuration files also contain the following global variables: default_host [optional] The default host to upload to. The default value of this variable is unset. no_parentheses_to_fullname [optional] Prevents dupload to add parentheses around the full name when making mail announcements. Default is 0 (false), set it to 1 to enable it. HOOKS
Hooks are a powerful way to add actions which will be run before or after a dupload (like the preinst and postinst script of dpkg). You have two sort of hooks: pre-upload and post-upload. Both are simple shell commands (executed by "sh -c" so you can use any shell tricks). Pre-uploads are always run (even in dry mode) and stop dupload if they fail (failure being mesured by the hook's exit status). Post-uploads are only run when you are not in dry mode and only if the uploading succeeded. Both sorts of hooks are run for a given category: changes, sourcepackage, package, file or deb. changes This hook is run once per "changes" file (given as an argument to dupload) with the filename as its parameter. sourcepackage This hook is run once per "changes" file with the source package name and its version as its two parameters. package This hook is run once per binary package (a "deb" file) with the package name and its version as its two parameters. file This hook is run once per uploaded file, with the file name as its parameter. deb This hook is run once per binary package (a "deb" file) with the filename as its parameter. Syntax Hooks are defined in two Perl hashes, %preupload and %postupload, each indexed by category. In addition to the global hashes, each host entry has two fields with the same names, for the host-specific hooks. The shell command will be substituted first: %1 will be replace by the first argument, etc. Per-host or global hooks A hook can be global (for all the hosts) or it can be for a specific host. If there is no specific hook, for a given category, the global one is used. Examples This one runs lintian before uploading. It is global and guarantee that you will always upload lintian-free packages (thanks to lintian return status). $preupload{'deb'} = 'lintian -v -i %1'; This one just display the name and versions of successfully uploaded packages. $postupload{'package'} = 'echo PACKAGE %1 %2 uploaded'; Unlike the two others, this one is specific to one host, master. $cfg{master}{preupload}{'changes'} = "echo Uploading %1"; LOCATION
The configuration is searched as following: /etc/dupload.conf ~/.dupload.conf The latest entries override the former. ENVIRONMENT VARIABLES
Those of Net::FTP for the FTP method: FTP_FIREWALL FTP_PASSIVE AUTHOR
Heiko Schlittermann <heiko@lotte.sax.de> Stephane Bortzmeyer <bortzmeyer@debian.org> dupload 2.7.0 February 2011 DUPLOAD.CONF(5)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy