The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script to find the average number or files? bbbngowc Shell Programming and Scripting 2 03-27-2008 12:57 PM
delete and move number forward..in file happyv Shell Programming and Scripting 6 02-28-2007 03:39 AM
awk script to find the number of files uni_ajay_r Shell Programming and Scripting 4 10-31-2006 06:58 PM
C Shell Script to convert a number into minutes Ringo Shell Programming and Scripting 1 08-07-2003 01:24 PM
Script to move trace files ST2000 Shell Programming and Scripting 4 11-21-2002 12:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-26-2007
amitsayshii amitsayshii is offline
Registered User
  
 

Join Date: Jun 2006
Location: JHB
Posts: 18
Red face Script to move certain number of files every 10 minutes.

Hi,

I need to move a certain number of files every 10 minutes from one folder to another. I have written the script below, however its not working, please advise.

#! /bin/ksh
start()
{

mv /test1/$(head -1000 /movetst) /test2/
sleep 600
}

stop()
{
exit
}

ls ti* > /movetest
count = cat /movetst | wc -l
if [ $count -eq 0 ]
then
start
else
stop
fi

Thanks&Regards,
Amit
  #2 (permalink)  
Old 02-26-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Something like this!

Code:
#! /bin/zsh

while :
do
  ls -1 somefile* | while read file
  do
    mv ./$file /anotherdir/$file
  done
  sleep 600
done

exit 0
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0