![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| repeat character with printf | ripat | Shell Programming and Scripting | 10 | 12-13-2007 05:52 PM |
| FTP repeat sending files | Euler04 | Shell Programming and Scripting | 1 | 11-24-2005 10:46 AM |
| Repeat Commands | dereckbc | UNIX for Dummies Questions & Answers | 6 | 01-04-2005 07:15 AM |
| any idea to repeat a action in VI | myelvis | UNIX for Dummies Questions & Answers | 6 | 11-26-2003 02:21 AM |
| Repeat a command in a shell | scotty | UNIX for Dummies Questions & Answers | 2 | 10-29-2002 10:42 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
to copy and repeat
Hi All,
I have done some looking at other threads but haven't found quite what I am looking for. I am a newbie to scripting and haven't got to where I want to you but here is my basic question. I have a script to copy a file and send it to another file with a date and time stamp. What I want to do is to be able to repeat this command within the script to happen every 30 (or 45 or 60) minutes. I have looked at doing a cron job but want more maual intervention to start and stop the script. So I am looking to just have the commands in the script repeat itself after a sleep. Here is the script I have so far: #! /bin/sh for i in `ls sband_log_error` do mv $i labfiles/int/sband/$i$(date +%F-%T) done Thanks, falcondown01 |
| Forum Sponsor | ||
|
|
|
|||
|
use 'sleep n'
-------------------------- Usage: sleep NUMBER[SUFFIX]... or: sleep OPTION Pause for NUMBER seconds. SUFFIX may be `s' for seconds (the default), `m' for minutes, `h' for hours or `d' for days. Unlike most implementations that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number. |
|
|||
|
Hi younggun,
Thanks for the info. I was able to finish this script today. Below is the final script and it worked for copying this file i need over and over. #! /bin/csh while 1 cp -p file_name /directory/to/copy/to/file_name'date '+%d%h%y_%T'' sleep 1800 end Again Thanks for the help! Falcondown01 |
|||
| Google UNIX.COM |