zip the folder and loaded to ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting zip the folder and loaded to ftp
# 1  
Old 10-21-2011
zip the folder and loaded to ftp

Hi ,

I am working on a script which will do the below things

1) It will checkout from the repository
2) then zip that checkout stuff
3) and put the zip folder to FTP server

Here my question is I am able to checkout successfully
through this coomand
svn co <url>/repositoyname/tags/splash_11_40

this command will checkout the splash_11_40 stuff .Is there any method through which I can zip the folder and with the same name and loaded to ftp.

Thanks
# 2  
Old 10-22-2011
Code:
#!/bin/bash
file=$1
/usr/bin/svn co <url>/repositoyname/tags/$file
/bin/gzip $file
HOST=192.168.1.2
LOGIN="user"
PASSWORD="pass"
ftp -i -n <<EOF
open $HOST
user $LOGIN $PASSWORD
put $file.gz /remote/srver/path/
quit
EOF

Code:
./run <filename>

Do modify the svn url, username, password etc as required!

--ahamed
# 3  
Old 10-23-2011
Hi

I will do it through the configuration file where all tags will specified and script will run from the crontab and read that configuration file and will checkout each tag one by one...here my solution is can we do it in while loop ...i.e. after putting one file or checkout stuff to ftp server it should not exit and run till all the checkot stuff loads to the FTP server .

But I have few doubts i.e. if one tag reaches to the FTP server it should be removed from the server from where I will take the checkout

this script will run from the crontab so there should be some way that the stuff that has reached to the FTP server remove from the chekout server immideatley after loads to the ftp server beacuse the svn server has very less space .there should be kind of check that if already one tag is on FTP server it should not run ...Please put your suggestion for this

After reaches to the FTP server a mail of all specified tag that loaded to the FTP server too

Last edited by rohit22hamirpur; 10-23-2011 at 08:25 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

HP-UNIX How to zip/compress files in a folder?

Environment: HP-Unix Operating System B.11.31 U ia64 I have a folder with around 2000 files. There are some files which sizes are more than 8 GB. I need to compress all the files in the folder into a single file, so that I can transfer the file. I tried with tar command, but the tar... (8 Replies)
Discussion started by: Siva SQL
8 Replies

2. UNIX for Dummies Questions & Answers

How to extract contents of ONLY one directory from ZIP folder.

I have a ZIP folder ( folder.zip or folder.jar ) which contains , lets say 3 directories under it ( directory1, directory2, directory3). How can i unzip the contents of directory2 ONLY ? I do not have to unzip the complete folder. TIA. (2 Replies)
Discussion started by: Sheel
2 Replies

3. UNIX for Dummies Questions & Answers

Zip recursive content of folder when (not current directory=

Hi, Is there a way to zip the content (recursively) of a folder other then the current directory, and keep the directory structure intact? Example: /var/tmp/myfolder ----------------- file1 ----------------- file2 ----------------- folder1 ------------------------ file3 Now I want... (3 Replies)
Discussion started by: jimih
3 Replies

4. UNIX and Linux Applications

Zip command for large folder

I am trying to zip a folder, its size is more than 3 GB. I used below command zip -r foo middleware -x "*path*" This command fails every time with message "Filesize exceeded limit" Can some one help me how to over come this problem and zip the entire folder without splitting it. ... (2 Replies)
Discussion started by: ariram
2 Replies

5. UNIX for Dummies Questions & Answers

Zip command (zip folder doesn't include a folder of the same name)

Hi guys, I have a question about the zip command. Right now I have a directory with some files and folders on it that I want to compress. When I run the zip command: zip foo -r I am getting a foo.zip file that once I unzip it contains a foo folder. I want to create the foo.zip, but that... (1 Reply)
Discussion started by: elioncho
1 Replies

6. Windows & DOS: Issues & Discussions

How can I upload a zip folder on a unix path from my windows folder?

Hello, I am an amature at UNIX commands and functionality. Please could you all assist me by replying to my below mentioned querry : How can I upload a zip folder on a unix path from my windows folder? Thanks guys Cheers (2 Replies)
Discussion started by: ajit.yadav83
2 Replies

7. Shell Programming and Scripting

Zip the folder

i want the scripts or unix command to zip the folder. (3 Replies)
Discussion started by: kingganesh04
3 Replies

8. UNIX for Dummies Questions & Answers

Zip a folder including its sub-folders.

Hi, I have a folder that contains a few sub-folders. I would like to zip that folder and KEEP the subfolders. What it does at the moment is taking all the files within the subfolders and zipping them into one big file (zip -r ...). Does anyone know the UNIX command to keep the subfolders in the... (3 Replies)
Discussion started by: gdog
3 Replies

9. UNIX for Dummies Questions & Answers

zip a folder

is it possible to zip a whole folder instead of each file individually? (3 Replies)
Discussion started by: rprules
3 Replies

10. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies
Login or Register to Ask a Question