TurnKey Linux Virtual Appliance Library

TKLBAM overrides fails if there is a space in the path

Hi,

I have just discovered tklbam and I am well impressed.

For one of my servers I need to exclude a number of files so I have added them to the overrides file. However if there is a space in the path or file name then tklbam falls over.

For example the line:

-/home/me/www/file withspace.htm

 in etc/tklbam/overrides gives

File "/usr/lib/tklbam/backup.py", line 53, in fromfile
raise Error(`limit` + " is not a legal limit")
backup.Error: 'withspace.htm' is not a legal limit

I have tried putting the path inside single or double quotes, no better, nor does escaping out the spaces with \ help.

Looking at the source could it would appear that the developers had forseen that several overrides could be put on the same line separated by spaces as there is "limits+=line.split()" in the code.

I have overcome the problem for the moment by substituting "\s" for the spaces in the file paths.

TIA

spam deleted

spam deleted

Please explain

Please explain - all your posts here seem to recommend long path tool with no further explanation.

 


Jeremy's picture

Hi Clive

I'm pretty sure that it was just a spammer...

FWIW this is fairly normal behaviour with Linux. By default many Linux tools (and most Windows commandline tools) do not like paths that include spaces (or a range of other characters). Best practice is to not include spaces in file and pathnames.

But OTOH as humans, spaces in path and filenames are aesthetically pleasing! :) I haven't tested it, but my suspicion would be that if you enclose the path in quotes (I'd try double quotes initially but if that doesn't work then try single ones too) then it should work. Have a go and let me know how it goes...

Thanks

Hi Jeremy,

Yes, pretty sure too - but willing to give him the benefit of the doubt...

Have already tried quotes (see OP) without success. Anyway the "\s" workaraound that I found seems to be still working.

Thanks for your input on this (old) problem

 

 


Jeremy's picture

Sorry I didn't read properly Clive

Thanks for the extra info though. Also sorry that no one gave you a timely response (to this very old issue...!)

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)