The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-31-2008
xgringo xgringo is offline
Registered User
 

Join Date: Dec 2006
Posts: 28
#!/bin/bash
oldest_mpd=`ls -1 -t /apps/*.mpd | head -1`
oldest_mpe=`ls -1 -t /apps/*.mpe | head -1`
oldest_mpf=`ls -1 -t /apps/*.mpf | head -1`

mv $oldest_mpd /apps/d1/
mv $oldest_mpe /apps/d1/
mv $oldest_mpf /apps/d1/

mv $oldest_mpd /apps/d2/
mv $oldest_mpe /apps/d2/
mv $oldest_mpf /apps/d2/

mv $oldest_mpd /apps/d3/
mv $oldest_mpe /apps/d3/
mv $oldest_mpf /apps/d3/

mv $oldest_mpd /apps/d4/
mv $oldest_mpe /apps/d4/
mv $oldest_mpf /apps/d4/

I can put this into cron every minute right but I don't think this is going to be that fast, what if the moves happen in less than a minute and it moves four suites and then it's done til the next minute? Is there a way to make it continuous? will this work?

Would I have to do something like this to reload the variable again?

Last edited by xgringo; 01-31-2008 at 02:25 PM..
Reply With Quote