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

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: load_path for running from a different directory  (Read 7522 times)
aktxyz
Newbie
*
Posts: 1


View Profile
« on: August 30, 2007, 11:30:59 AM »

If you add this line to the top of your s3cmd.rb, you can run the script from anywhere.

$LOAD_PATH << File.expand_path(File.dirname(__FILE__))

Also, just preference, I like to put the s3sync folder in my path, and then have aliases like this setup...
alias s3lb='s3cmd.rb listbuckets'
Logged
wkharold
Newbie
*
Posts: 1


View Profile
« Reply #1 on: September 09, 2007, 04:34:16 PM »

Nice touch. Thanks.

Attached is a mod I made to s3config.rb to look for s3config.yml in the .s3conf, $HOME/.s3conf, and /etc/s3conf directories. That way you can lock down your s3config.yml in an appropriate directory but still run the s3cmd/s3sync.rb scripts from anywhere.

... WkH
Logged
mla
Newbie
*
Posts: 1


View Profile
« Reply #2 on: December 05, 2007, 02:45:35 PM »

That's excellent. Can we get that merged into official version?
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #3 on: December 06, 2007, 04:09:45 AM »

I've got a handful of these contributed tweaks and so I'll try to do a nice little "ease-of-use" update this weekend if I have time.
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #4 on: January 06, 2008, 09:59:57 AM »

If you add this line to the top of your s3cmd.rb, you can run the script from anywhere.

$LOAD_PATH << File.expand_path(File.dirname(__FILE__))


Will be added today in sync and cmd; watch announcements.
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #5 on: January 06, 2008, 10:18:26 AM »

Nice touch. Thanks.

Attached is a mod I made to s3config.rb to look for s3config.yml in the .s3conf, $HOME/.s3conf, and /etc/s3conf directories. That way you can lock down your s3config.yml in an appropriate directory but still run the s3cmd/s3sync.rb scripts from anywhere.

... WkH


Will be added to main version today. Check announce.
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!