1) We will receive two zip files on every Friday on Server A.
say for example offshoreMonthly_20110727.zip,offshoreDaily_20110727.zip
2)The above files from Server A need to be transferred to Server B. Once the files got transferred successfully the above files need to be archived to Archive folder in Server A.
3)We may receive single file in some Friday.
4) I have to send email notification along with file names once the file(s) transferred successfully.
you probably want to write a script that does the transfer and sends email, and then invoke the script from cron.
Your cron entry should look like:
This sets the cron to invoke script at 11:00 pm, since you said you'd receive the files on Friday, you wanna make sure it runs after you receive the file.
And for the transfer itself, I'd suggest scp/ssh instead of ftp. You'll get the files there through a secure tunnel this way, plus you can speed up the transfer by compressing them on the way.
To use ssh, you need to setup the servers with keys, so that the sender can authenticate itself. This is not at all difficult, and there is extensive documentation on the subject.
E.g. here. I personally use RSA keys instead of DSA.
Once that is out of way, you can write the script:
The tarring is probably a little redundant, since your files are already zipped, but still, you have a more general way, in case you wanted to send over whole directories etc.
In your case, the sending could be simplified to
which wouldn't take much longer. Don't forget to make your script executable:
and test it manually:
HI Guys,
I want to download files from FTP Server to my Unix server.
I have tried , buy No Luck .
Below Command i have tried.
1-Wget - Error "wget' not found"
2.ftp -n $HOST ...Not Working.
3.scp -i ftp://user:passowrd@hostname:21/ran/on/test.txt
Any Suggestion (2 Replies)
I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output.
Is it possible to transfer files from Windows server to unix server through any shell script?
If so can you please help me with the details.
Thanks in... (8 Replies)
We have RHEL 5.8 in our environment, I had a query whether we can implement an FTP server using vsftpd package and Linux configurations like setsebool without using any external FTP clients like FileZilla etc. I am very confused on this. The FTP functionalities that should be present are download &... (3 Replies)
Hi All,
I need your expertise in finding a way to solve my problem.Please excuse if this is not the right forum to ask this question and guide me to the correct forum,if possible.
I am a DBA and on a daily basis i have to ftp huge dump files from my company server to my laptop and then... (3 Replies)
Guys,
Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session.
I am using RHEL 5.3.
root@]# ll
total 1740... (2 Replies)
Hi,
I need to copy few files from remote server to local server.
I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed.
... (5 Replies)
Hi,
The Setup is like this. I'm connecting to Unix machine from my local machine. After connecting to Unix M/c, i need to connect FTP server. Am successful in connecting to FTP server, but am not able to download the file from the ftp server to my local machine. I have different user id's and... (1 Reply)
Hi,
I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
I have a file --> file1.txt
i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this?
thanks in advance! Im a newbie to this... (4 Replies)