Sponsored Content
Top Forums Shell Programming and Scripting Random web page download wget script Post 302796769 by shadyuk on Saturday 20th of April 2013 07:02:53 PM
Old 04-20-2013
Power

Not sure what the best approach is here. Please bare with me while I attempt to explain in a rudimentary fashion. What I need it to do is this:


user 1
download url
wait random
loop

&

user 2
download url
wait random
loop

&

user n
download url
wait random
loop

What i'm trying to avoid is running the following code in 20 different sessions i.e. setsid by using a single script to do the same job.

Code:
#!/bin/sh
url_list=( http://www.bbc.co.uk http://www.cnn.com http://www.msn.com )

for (( ; ; )); do
  wait=`expr $RANDOM % 120 + 30`
  n=`expr $RANDOM % 3`
  url=${url_list[$n]}
  wget -p $url
  sleep $wait
done

I hope that makes sense.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

running shell script thru WEB page ....

....passing variable via list... here 's the HTML code extract : **************** <form method=post action=http://servername/cgi-bin/cgi-comptage_diff.ksh> <table border...........> .............. </table> <table bgcolor=#FFFFFF width="980"> ... (6 Replies)
Discussion started by: Nicol
6 Replies

2. Shell Programming and Scripting

Script to download file using wget

Hi I need a Shell script that will download a text file every second from a http server using wget. Can anyone provide me any pointers or sample scripts that will help me go about this task ??? regards techie (1 Reply)
Discussion started by: techie82
1 Replies

3. Shell Programming and Scripting

how to redirect to a web-page by shell script

Dear all, I am calling a korn shell script(CGI script) by a web-page. This shell script do some checking in a unix file and return true or false. Now within the same script, If it returns true then I want to redirect to another web-page stored in htdocs directory. Example: Login page sends a... (3 Replies)
Discussion started by: ravi18s
3 Replies

4. Shell Programming and Scripting

Perl script to copy contents of a web page

Hi All, Sorry to ask this question and i am not sure whether it is possible. please reply to my question. Thanks in advance. I need a perl script ( or any linux compatible scripts ) to copy the graphical contents of the webpage to a word pad. Say for example, i have a documentation site... (10 Replies)
Discussion started by: anand.linux1984
10 Replies

5. UNIX for Dummies Questions & Answers

Possible to download web page's text to a file?

Hi, Say there is a web page that contains just text only - that is, even the source code is just the text itself, nothing more. An example would be "http://mynasadata.larc.nasa.gov/docs/ocean_percent.txt" Is there a UNIX command that would allow me to download this text and store it in a... (1 Reply)
Discussion started by: Breanne
1 Replies

6. HP-UX

Help running a unix script from a web page

First, let me state that I am completely out of my realm with this. I have a server running HPUX. I'm not even sure if this can be considered a UNIX question and for that let me apologize in advance. I need to create a web page where a client can input 2 variables (i.e. date and phone number).... (0 Replies)
Discussion started by: grinds
0 Replies

7. UNIX for Dummies Questions & Answers

List and download web page files

Hello, Does anyone know of a way to list all files related to a single web page and then to download say 4 files at a time simultaneously until the entire web page has been downloaded successfully? I'm essentially trying to mimic a browser. Thanks. (2 Replies)
Discussion started by: shadyuk
2 Replies

8. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

9. Shell Programming and Scripting

Refresh web page in bash script

hello, I am trying to refresh my web page which is created in bash script. I have a HTML page which when press a button calls a bash script. this bash script created the same page with dynamic data. When pressing the button I am calling to a function that set time out of 7 seconds and and after... (1 Reply)
Discussion started by: SH78
1 Replies

10. UNIX for Beginners Questions & Answers

How to use cURL to download web page with authentification (form)?

Hello, I'm new in the forum and really beginer, and also sorry form my bad english. I use linux and want to create little program to download automaticaly some pdf (invoices) and put in a folder of my computer. I learn how to do and programme with ubuntu but the program will be implemented... (1 Reply)
Discussion started by: MarcelOrMittal
1 Replies
SMBGET(1)																 SMBGET(1)

NAME
smbget - wget-like utility for download files over SMB SYNOPSIS
smbget [-a,--guest] [-r,--resume] [-R,--recursive] [-u,--username=STRING] [-p,--password=STRING] [-w,--workgroup=STRING] [-n,--nonprompt] [-d,--debuglevel=INT] [-D,--dots] [-P,--keep-permissions] [-o,--outputfile] [-f,--rcfile] [-q,--quiet] [-v,--verbose] [-b,--blocksize] [-?,--help] [--usage] {smb://host/share/path/to/file} [smb://url2/] [...] DESCRIPTION
This tool is part of the samba(7) suite. smbget is a simple utility with wget-like semantics, that can download files from SMB servers. You can specify the files you would like to download on the command-line. The files should be in the smb-URL standard, e.g. use smb://host/share/file for the UNC path \HOSTSHAREfile. OPTIONS
-a, --guest Work as user guest -r, --resume Automatically resume aborted files -R, --recursive Recursively download files -u, --username=STRING Username to use -p, --password=STRING Password to use -w, --workgroup=STRING Workgroup to use (optional) -n, --nonprompt Don't ask anything (non-interactive) -d, --debuglevel=INT Debuglevel to use -D, --dots Show dots as progress indication -P, --keep-permissions Set same permissions on local file as are set on remote file. -o, --outputfile Write the file that is being download to the specified file. Can not be used together with -R. -f, --rcfile Use specified rcfile. This will be loaded in the order it was specified - e.g. if you specify any options before this one, they might get overriden by the contents of the rcfile. -q, --quiet Be quiet -v, --verbose Be verbose -b, --blocksize Number of bytes to download in a block. Defaults to 64000. -?, --help Show help message --usage Display brief usage message SMB URLS
SMB URL's should be specified in the following format: smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] smb:// means all the workgroups smb://name/ means, if name is a workgroup, all the servers in this workgroup, or if name is a server, all the shares on this server. EXAMPLES
# Recursively download 'src' directory smbget -R smb://rhonwyn/jelmer/src # Download FreeBSD ISO and enable resuming smbget -r smb://rhonwyn/isos/FreeBSD5.1.iso # Recursively download all ISOs smbget -Rr smb://rhonwyn/isos # Backup my data on rhonwyn smbget -Rr smb://rhonwyn/ BUGS
Permission denied is returned in some cases where the cause of the error is unknown (such as an illegally formatted smb:// url or trying to get a directory without -R turned on). VERSION
This man page is correct for version 3.0 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. The smbget manpage was written by Jelmer Vernooij. SMBGET(1)
All times are GMT -4. The time now is 12:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy