script that will automatically extract


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script that will automatically extract
# 1  
Old 09-07-2010
script that will automatically extract

how do i write a script that will automatically extract rar files after the download in a particular folder?

can you give me an idea please? Smilie or is there an existing script for this?
# 2  
Old 09-07-2010
My suggestion is:

1.- Monitor the download process,
2.- If is not present, I supose it has finished
3.- Then I try to unrar the file

1.-
Code:
while [ 1 ] ; do
  ps | grep "download_process" || break
  sleep 60
done

2 exists only as a condition
3 depend on your tools, maybe something like gunzip downloadedFile.gz, but rar is not familiar to me on unix systems
# 3  
Old 09-07-2010
Is it enough?
Code:
cd /source_rar && wget http://......file.rar && cd /target && unrar -e /source_rar/file.rar

It's means:
if successful execute the next command
# 4  
Old 09-08-2010
what does
Code:
sleep 60

mean?

Quote:
Originally Posted by john1212
Is it enough?
Code:
cd /source_rar && wget http://......file.rar && cd /target && unrar -e /source_rar/file.rar

It's means:
if successful execute the next command
i'd also like to extract file such as 7z and zip.

say, if zip, rar and 7z exist, then eztract to mkdir %d or something..can you help me with this please.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

Logout automatically when exiting a script

Hi, I am using SCO Unix. I write a script to execute a program by calling exec program The script will check the program is still there or not, if not, then it will exit the script by calling exit So if I press DEL to quit the program, the script will exit, but it will logout... (6 Replies)
Discussion started by: dannychan
6 Replies

2. Shell Programming and Scripting

How to run script automatically every 12 hour once?

Hi ! all, I have once script to remove temporary cache and temporary xml files looks like this, as it is taking more space, I would like to run automatically every 12 hour once, and then I want to receive some log as acknowledgement #!/bin/sh echo "Removing logs and temp files (typically... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

3. Shell Programming and Scripting

Automatically UNIX script

Write a unix script to do the following automatically- 1. Identify the latest path version directory under: /data/cs/chk. The latest at this time is 15_1_3. /data/cs/chk … drwxr-x--- 2 dba tms 4096 Jan 22 11:18 15_1_2 drwxr-x--- 2 dba tms 4096 Jan 22 11:18 15_1_3 2. Check for any new... (1 Reply)
Discussion started by: roy1912
1 Replies

4. Shell Programming and Scripting

how to write bash script that will automatically extract zip file

i'm trying to write a bash script that that will automatically extract zip files after the download. i writed this script #!/bin/bash wget -c https://github.com/RonGokhle/kernel-downloader/zipball/master CURRENDIR=/home/kernel-downloader cd $CURRENDIR rm $CURRENDIR/zipfiles 2>/dev/null ... (2 Replies)
Discussion started by: ron gokhle
2 Replies

5. Shell Programming and Scripting

Script to automatically enter a password

I need to retrieve thousands of lines of information from hundreds of nodes. Each node requires a passowrd in order to retrieve the information. Fortunately, the password is the same for each one of them. So I am trying to come up with a script that would allow me to include the password so I can... (0 Replies)
Discussion started by: Ernst
0 Replies

6. Shell Programming and Scripting

How to run a script automatically

Hi All, How can i run a script every week automatically. Thanks & regards, Sam (5 Replies)
Discussion started by: sam25
5 Replies

7. UNIX for Advanced & Expert Users

i want a script to execute if the time is 12:00 automatically

i write a script for displaying a xmessage.But i want it to run automatically for every one hour.can any one help me. (2 Replies)
Discussion started by: lakshmananindia
2 Replies

8. Shell Programming and Scripting

Extract lines from a file automatically. Please a Help

hello, hope you can help me: ive got a file called archivos The content or structure of this file is ./chu0/filechu ./chu1/filechu I extract each line from this file manually and redirect to a file, and it Works fine, so the command line is: awk ‘/chu0/ {print $0}' < archivos >... (8 Replies)
Discussion started by: alexcol
8 Replies

9. UNIX for Dummies Questions & Answers

how to run a Script automatically

How to make a script run automatically using a cron?? i do not know abt cron...... if i have simple.sh file and i need this to run everyday at a particular time what needs to be done thanks in advance (4 Replies)
Discussion started by: hamsa
4 Replies

10. UNIX for Dummies Questions & Answers

How to run a script automatically ?????

Hi All, How to run a script automatically using cronjob everyday from Monday to Friday 9A.M to 5P.M at an interval of ONE HOUR.I want the complete syntax means how to put in the cron job and there after. URGENTLY NEED HELP THANKS IN ADVANCE CHEERS Arunava (7 Replies)
Discussion started by: arunava_maity
7 Replies
Login or Register to Ask a Question