Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.rb/tmp_path appears to be not respected #668

Closed
TemporarilyOffline opened this issue May 18, 2015 · 6 comments
Closed

config.rb/tmp_path appears to be not respected #668

TemporarilyOffline opened this issue May 18, 2015 · 6 comments

Comments

@TemporarilyOffline
Copy link

I have tried

tmp_path '/mnt/backup'
tmp_path = '/mnt/backup'
tmp_path('/mnt/backup')

and setting --tmp_path /mnt/backup on the cli.

Setting on the CLI worked fine, the config.rb examples do not. When there are no CLI options, the tmp_path is actually root_path/.tmp. root path is specified on the command line so that it knows where to find config.rb.

@tombruijn
Copy link
Member

tmp_path = '/mnt/backup' will not work because you're assigning a local variable there. The other two should work.

So you're already using --root-path in this scenario? But then it doesn't
Can you post your complete config please?

@TemporarilyOffline
Copy link
Author

My command line:

/usr/bin/backup perform --trigger rotation --root-path /var/backup

My config file:

# encoding: utf-8

##
# Backup v4.x Configuration
#
# Documentation: http://meskyanichi.github.io/backup
# Issue Tracker: https://github.com/meskyanichi/backup/issues

root_path '/var/backup'
tmp_path  '/mnt/backup'
data_path '/var/backup/data'

Logger.configure do    
  console.quiet     = true            # Same as command line: --quiet
  logfile.max_bytes = 2_000_000       # Default: 500_000
  syslog.enabled    = false           # Same as command line: --syslog     
  syslog.ident      = 'BACKUP' # Default: 'backup'             
end    

Storage::S3.defaults do |s3|  
  s3.access_key_id        = "access_key_id"
  s3.secret_access_key    = "secret_access_key"  
  s3.bucket               = "bucket-name"
  s3.region               = "region"
  s3.path                 = "path"
end

@tombruijn
Copy link
Member

@TemporarilyOffline woops.. I can confirm that this doesn't work.. Sorry about that.

The problem seems to be here:

update(dsl._config_options) # from config.rb
update(options) # command line takes precedence

Line 44: The values from your config file are set.
Line 45: Paths are overridden if they are given through the CLI.

However, the contents of that hash are:

{"config_file"=>"",
 "root_path"=>"/Users/tom/Desktop/backup",
 "data_path"=>"",
 "log_path"=>"",
 "tmp_path"=>"",
 "quiet"=>false,
 "syslog"=>false,
 "logfile"=>true,
 "check"=>false,
 "trigger"=>"issue_668"}

All the path values are empty. When they are being updated this empty value is set and then the next time backup asks for those paths it finds no value and falls back on the default.

I'll start looking for a fix. In the meantime you have to supply these paths through the CLI apparently it's the only config it really listens to.

@TemporarilyOffline
Copy link
Author

Thanks Tom!

@tombruijn
Copy link
Member

@TemporarilyOffline some bad news. I spend some 4 hours on this problem (I use a time tracker) and it's difficult to fix. Well not this problem, but everything else around it. The config paths have so many damn conditionals on the whole configuration section that adding another exception to it is almost impossible. I now have it down to 21 failing specs, but I'm giving up.

I can much better spend my time on the next version where we already sorted the configuration out.

I hope the workaround of setting everything on the CLI works for now.

@stale
Copy link

stale bot commented Nov 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 24, 2020
@stale stale bot closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants