wting / flyback

Automatically exported from code.google.com/p/flyback
0 stars 0 forks source link

Does not work if backup target dir has a space in it #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Specify a target directory with a space in the path
2. Run --backup
3. It will fail

What is the expected output? What do you see instead?

It does the backup but fails before it can clear the lock file

What version of the product are you using? On what operating system?

0.4/ubuntu HH

Please provide any additional information below.

I think it's in backup_backend.py/get_free_space (167). The command sent to
popen has this space in it and the shell dies horribly. My python fu wasn't
up to working out how to fix it.

Original issue reported on code.google.com by francis....@gmail.com on 18 Jul 2008 at 3:35

GoogleCodeExporter commented 9 years ago
I expect that it would be like this:

stdin, stdout = os.popen4( 'df "%s"' % parent_backup_dir )

or even better like this:

stdin, stdout = os.popen4( 'df "%s"' % parent_backup_dir.replace('"', '\\"') )

Replacing ' or " in the folders could also be done in get_backup_command, 
backup,
restore, delete_too_old_backups, and delete_old_backups_to_free_space. For 
replacing
' you could use .replace("'", "'\\''")

Original comment by ejon...@gmail.com on 31 Jul 2008 at 1:51

GoogleCodeExporter commented 9 years ago
Good call - I'm a rubyist and the string escaping just didn't occur to me.

Original comment by francis....@gmail.com on 31 Jul 2008 at 2:14

GoogleCodeExporter commented 9 years ago
fixed in svn

Original comment by pub...@kered.org on 5 Dec 2008 at 6:58