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

Remove recursive scanning of backup file #2

Open
kwikadi opened this issue Jan 3, 2015 · 6 comments
Open

Remove recursive scanning of backup file #2

kwikadi opened this issue Jan 3, 2015 · 6 comments

Comments

@kwikadi
Copy link

kwikadi commented Jan 3, 2015

set topdown=False inside os.walk., at least till you replace it with scandir (which looks pretty neat, might steal that idea)

@dufferzafar
Copy link
Owner

I don't really get what you mean by "recursive scanning of backup file".

Also, If we set topdown=False we won't be able to ignore the directories (See this).

@kwikadi
Copy link
Author

kwikadi commented Jan 3, 2015

A very poor implementation would require you to scan the backup folder after backing up the entire drive, and removing offending folders.
Cant think of anything else right now. If I do, I'll let you know?

@dufferzafar
Copy link
Owner

We're just trying to fix the bug that destination can't be a child of the source directory (while keeping the rest of the functionality of the script as is) right? because if that's the case I've thought of something. Too lazy to implement it though.

@kwikadi
Copy link
Author

kwikadi commented Jan 4, 2015

Huh. What is it?

@dufferzafar
Copy link
Owner

We just store all the directories in source and then walk over every one of them?

children = os.listdir(src_root)

for child in children:
    for cur_dir, dirs, files in os.walk(os.path.join(src_root, child)):
        ... rest of the code same ...

@dufferzafar
Copy link
Owner

Now that I've written it, I can see that this is only a partial solution and won't work in all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants