Bulk load testing in regular intervals | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Unix/Linux Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Bulk load testing in regular intervals

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 02-01-2013
talk1234 talk1234 is offline
Registered User
 
Join Date: Feb 2010
Last Activity: 4 March 2013, 12:02 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Bulk load testing in regular intervals

I need to write a script which can send files via sftp communication continously for half an hour or any given duration of time. I have already written a batch file to send multiple file via SFTP.
but I need to know how can we set a duration of half an hour through shell script. Can we use sleep command for this.

Any help would be appreciated.

Thanks
Sponsored Links
    #2  
Old Unix and Linux 02-01-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 31 March 2015, 10:49 PM EDT
Location: NM
Posts: 10,411
Thanks: 325
Thanked 854 Times in 793 Posts

Code:
sec=1800  # 30 minutes
pid=$$
sleep $sec && kill $pid & > dev/null
while true
do
   # run your sftp script
done

The child process sleeps for $sec, wakes up and terminates the parent process.
Sponsored Links
    #3  
Old Unix and Linux 02-01-2013
talk1234 talk1234 is offline
Registered User
 
Join Date: Feb 2010
Last Activity: 4 March 2013, 12:02 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you Jim for your help. I have tried to run following script:

Code:
#!/bin/bash
sec=3  # 30 minutes
pid=$$
sleep $sec && kill $pid & > dev/null
while true
do
  echo "hello world"
done

but it shows following error:
delay.sh: line 8: syntax error near unexpected token `done'
delay.sh: line 8: `done'
arguments must be process or job IDs

I am trying to run this script on cygwin. I am not sure if these errors are related to this.
Thanks
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Selecting files in regular intervals from a folder rpd25 Programming 2 01-30-2012 04:21 AM
Remove a block of Text at regular intervals marcozd Shell Programming and Scripting 15 11-03-2010 11:46 AM
Pls Help me out ... I want to check process status at regular intervals of time srinivasvandana Shell Programming and Scripting 5 08-02-2008 03:44 AM
performing a task at regular intervals mridula Programming 2 11-14-2005 04:26 AM
mailing myself at regular intervals... timepassman Shell Programming and Scripting 4 08-21-2005 08:11 PM



All times are GMT -4. The time now is 10:26 AM.