Copy the newest file from a different server to your home server.
Hi all,
So I am on server 1, and I want to grab the newest file from a particular directory on server 2, and place this in a directory on server 1.
I am trying to use:
This works, and gets me the newest file in a particular directory. Using svn `ls -tr | tail -1` etc I can grab the newest file and copy it somewhere else if the newest file is in the directory i'm currently in.
The problem is using ls -tr | tail -1 in an attempt on server 2, as ls seems to only look in the directory i'm currently in and not in another.
Is there a way I can use that command in a way like this example:
The $foo here only looks in the directory i'm in, not user@host etc.
Hope this ramble makes sense!!
Alex
---------- Post updated at 07:58 AM ---------- Previous update was at 06:25 AM ----------
Just to add to this.
Is what I am attempting.
The ls -tr | tail -1 looks in host1, rather than the latest file in the directory ending /reports/...I need a way to grab the latest file from /reports/ and place it in host1.
Moderator's Comments:
Please use next time code tags for your code and data
:wall:Hi all,
I have two servers : server A and server B
Weekly wise i use to receive files to server A to one particular location say /source/location . NOTE: In this location there will be other files also present other than these weekly arrival 18 files.
My task :
i need a... (7 Replies)
Hi ,
Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file.
We want to copy a file on multiple servers and run the installation.
Thanks (1 Reply)
Hi All,
I am generating report in a Linux server and once the report is generated the report(.txt file) needs to be automatically saved in a Windows servers.
So i am looking for a script to transfer the file automatically from Linux server to Windows server?
Please advise.
Thanks... (3 Replies)
We would be migrating unix solaries to Linux redhat.
Basically source is unix and target is linux.
i would like to copy entire file system unix/source/* to target linux/souce/*
but target linux has only folder setup so what ever files copied need to be placed in the linux server with same... (8 Replies)
Hi, I need a sample of a script that will check a specific directory multiple times throughout the day, and scp the newest file to another server.
Example: current file is misc_file.txt_02272011 (the last part is the date), once that has been secure copied, another one may come in later the... (1 Reply)
can some one help me to write a shell script that copy one file from one server to multiple server
ex:suppose i wnt to copy file abc.txt which is in server 1
to server2,server3,server4....:confused: (6 Replies)
I am getting the fallowing error when i am trying to execute the scp commomd in shell script
warning: You have no controlling tty. Cannot read confirmation.
warning: Authentication failed.
Disconnected; key exchange or algorithm negotiation failed (Key exchange failed.).
scp2: warning: ssh2... (1 Reply)
Hi All,
what is the comand to log off the remote server?
I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is:
login the remote server:
=================
ssh hostB
cd /data/test
find . -mtime -7 -ls | awk '{print... (4 Replies)
hi, which Command is used for copy a file from one server to another server, please provide the syntax and give one small example...
Thanks in advance
sarwan (2 Replies)
i'm setting up a solaris 9 box to be my home network's DNS server. actually it's up and running, but it's set as a caching-only name server.
can i set it up to be the primary name server? what are the advantages if i can set it up to be a primary name server vs. a caching only name server? (3 Replies)