Xsanity Sanity for Apple's Xsan and Final Cut Server.
  
Tuesday, May 21 2013 @ 03:36 AM EDT
Topics
Storage (39)
People (1)
Xsan (103)
How To (26)
User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User
Who's Online
Guest Users: 9
Sponsorship

Xsanity is proudly sponsored by:

Tekserve
The Old Reliable Mac Shop

Defrag script for AFP/SMB reshares

 
Post new topic   Reply to topic    Xsanity Forums Forum Index -> Resharing
View previous topic :: View next topic  
Author Message
Mark Fletcher
JBOD
JBOD


Joined: 23 Mar 2009
Posts: 1

PostPosted: Mon Mar 23, 2009 12:02 pm    Post subject: Defrag script for AFP/SMB reshares Reply with quote

Hi,

I wrote this script to run snfsdefrag on our AFP reshares. It reads the share paths from dslocal (the script could be easily adapted for 10.4.x servers by modifying the dscl command). We run this every night via a launchd item...

Code:
#!/usr/bin/ruby

sharepoints = `dscl . readall /SharePoints directory_path | grep directory_path | awk '{print $2}'`

sharepoints.each do |sharepoint|
  puts "Defragging " + sharepoint
  `/usr/bin/snfsdefrag -r #{sharepoint}`
  puts "Finished " + sharepoint
end


Hope someone else finds it useful...

Mark
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Xsanity Forums Forum Index -> Resharing All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Best Viewed on a Mac | Suggested Browser: Whatever floats yer boat.