S3Sync.net
February 02, 2014, 01:27:07 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: s3sync.rb to run without current directory defined to where s3try.rb, S3.rb are.  (Read 5120 times)
cm_gui
Newbie
*
Posts: 13


View Profile
« on: February 17, 2007, 05:28:36 PM »

Hi Greg

Thank you for the excellent s3sync.rb script.
It is working great for us.   

But we are running s3sync.rb from a bash script, and it would be nice if s3sync.rb is able to run without having to define the working directory to where s3try.rb, S3.rb, etc. are.     

This was actually discussed before -
http://developer.amazonwebservices.com/connect/message.jspa?messageID=46318#46318
http://developer.amazonwebservices.com/connect/message.jspa?messageID=46312#46312

If the working directory is not defined to where the s3sync scripts are, these error messages will appear -
<< /usr/local/etc/s3sync/s3sync.rb:18:in `require': no such file to load -- thread_generator (LoadError)  from /usr/local/etc/s3sync/s3sync.rb:18uuid /usr/local/etc/s3sync/s3cmd.rb:12:in `require': no such file to load -- s3try (LoadError) from /usr/local/etc/s3sync/s3cmd.rb:12 >>

I tried changing the scripts.   For example, changingline 18 in s3sync.rb from "require 'thread_generator'"  to "require '/usr/local/etc/s3sync/thread_generator'", etc.   But this introduced other errors.

If you can modify the scripts so that they can be run from anywhere, that would be great.
Thank you.

« Last Edit: February 20, 2007, 12:31:24 PM by cm_gui » Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #1 on: February 17, 2007, 10:06:57 PM »

Does anyone know whether the "gem" distribution (see home page) solves this issue?  I've never tried it.

If so, then I guess it might be time for me to look into what's needed to distribute the main package as a gem.
Logged
lowflyinghawk
Jr. Member
**
Posts: 52


View Profile
« Reply #2 on: February 18, 2007, 07:31:04 AM »

why not set RUBYLIB to point to the library directory?  it is a colon-separated string on linux and semicolon separated on windows (but on windows you can set it permanently via somewhere in My Computer I think).  for example, in bash:

export RUBYLIB=/usr/local/whatever/lib:/home/me/lib
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #3 on: February 19, 2007, 08:15:10 AM »

OK the official stance is now to use the RUBYLIB.  I'm still open to the idea of gem-ing, but I don't know anything about it at the moment.
Logged
ryantate
Newbie
*
Posts: 3


View Profile
« Reply #4 on: February 22, 2007, 01:16:03 PM »

Another possibility is to use the -I option when calling ruby from your shell script, which allows you to specify a ruby lib dir without using an envionment var. My shell script has lines that look like:

ruby -I s3syncDir s3syncDir/s3sync.rb -r --ssl --delete  /home/foo/bin bucketName:home/foo

... and the working dir of my shell script is NOT s3syncDir.

Sorry if this was mentioned previously, but I didn't see it in the AWS thread (just re-skimmed briefly).
« Last Edit: February 22, 2007, 01:21:13 PM by ryantate » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!