Need to copy the latest file from Unix server to Shared folder
Hi All,
One job in unix server will generate .csv files daily. I need to copy the latest of these .csv file from the unix server to the shared drive/folder in windows through unix script. My shared folder will look something like
W:\some folder(for example). Could any one of you please help me out with the unix script which will transfer the latest file from unix server to shared folder.
For starters, how is the data accessed? Samba? FTP? SCP?
If it's really a windows file share(samba), then there's things outside the script you'll need to set up first. You'll need to get the directory mounted on your server. How to do that depends on what your server actually is.
Last edited by Corona688; 10-06-2011 at 11:46 AM..
---------- Post updated at 09:57 AM ---------- Previous update was at 09:46 AM ----------
As i am new to unix script, can you please tell me how to mount the directory to the unix server?
For you info, i used the below script.
Here home/manuownr/temp is the unix path(Source) and \auviccf03\temp is the shared drive (Destination)
FTP is not a Windows file share. If it's FTP, you can use ftp and not mount anything.
That KSH script is full of FTP commands and won't work, because FTP is not KSH. You have to feed them into the ftp command, which is different on different versions of UNIX. What's your system?
"\\auviccf03\temp" is probably not a folder you can CD to, you'll need the actual folder not the network one. If you only have the network one then it's not FTP after all.
You've also got the mput before you change directory, which is probably not what you want.
Last edited by Corona688; 10-06-2011 at 12:10 PM..
Hi,
Is there a way I can copy a file from a server to a local folder (i.e. My Documents)? can it be done by scp?
I tried this but it just rename the file as the folder it has to be transferred at.
scp -r name@some_server:/home/user/file.txt 'somehere\home\home_dir'
Thanks. (4 Replies)
Hi All,
I want to transfer file from UNIX to shared locataion .
Shared location doesn't resides on my system.
Can somebody tell me is there any way i can transfer file from UNIX to shared location without using any tool WINSCP.
Thanks,
Amit (1 Reply)
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)
#!/bin/bash
for i in {1..1536..1}
do
#find /home/test/Desktop/up111/workplace/Malware/$i/logs
for a in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
#max=a
for b in /home/test/Desktop/up111/workplace/Malware/$i/logs/*
do
... (4 Replies)
Hi All,
We have a requirement of pulling a file from shared folder to our unix box(Our application Servers). The Shared Folder and the servers are in teh same domain for eg UK domain
For this purpose I got information like if in both source and destination ftp is enabled we can fetch the... (2 Replies)
Hi Expert Team,
I performed the below piece of code to copy the latest file in the remote server's directory to the same server's other directory.
But it is not working properly.
How can i handle this? Can you please help me..?
ssh ${REMOTE_USERID}@${REMOTE_HOSTNAME} "cp -p `ssh... (3 Replies)
I am trying to copy a folder and all its contents from HP Unix box to RH linux, using the following.
rsync -avz -e "ssh" /users/www/webroot/docFiles/Division/Ctry ftpuser@10.4.xxx.yz:/data/webroot/development/contentfiles/webroot/docFiles/Division/Ctry/QAfiles
And it throws a consistent... (2 Replies)
Hi,
I have a problem.
I have some text files in a folder. The names can be like:
emp_20080307053015.dat
emp_20080306053015.dat
emp_20080305053015.dat
emp_20080304053015.dat
The date format appended is like yyyymmdd and timestamp.
What i need is i have to copy the latest file every... (3 Replies)
Hi,
I want to copy a file from unix machine to a shared windows directory.
i tried using the ftp command but i was able to transfer the file only to my local directory.
Is there any way we can transfer/copy the files from unix to windows shared directory..........
Please help.
Thanks (5 Replies)