shell script to copy files frm a linux machine to a windows machine using SCP
I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine.
for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to windows
On July 21, It will become 21.txt and it also should be copied.
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.
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???
The explanation you provided still seems unclear to me... but I assume that the file with unique name is generated by other application everyday, so you won't be requiring script to generate filename, but you only require a script to extract the name of latest file and scp it to windows machine....
The script I've provided you earlier, if you look carefully provides you latest file in that directory, however if you want some specific files only to be found in the result set, you can have 'grep' after 'ls -lgt', like
To run this script daily you can put this script in cron schedule, I hope you are aware of it nicely!
Quote:
Originally Posted by nithin6034
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.
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..
Last edited by Franklin52; 07-21-2011 at 03:53 AM..
Reason: Please use code tags for code and data samples, thank you
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)
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)
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)
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)
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)
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)
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)
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)
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)