Commit 70c73fbf authored by Matthieu Boileau's avatar Matthieu Boileau

Fix pb with wget command that expand " character

parent 010ee386
......@@ -71,7 +71,7 @@ rsync -av content/ ../website/content/
### 7. Transférer les fichiers joints vers le nouveau site
```
rsync -av attachments/spip/ ../website/content/attachments/spip/
rsync -av --delete attachments/spip/ ../website/content/attachments/spip/
```
## Notes
......
......@@ -27,13 +27,17 @@ if __name__ == '__main__':
for directory in "IMG", "Documents":
dest_dir = os.path.join(DOWNLOAD_DIR, directory)
print(f"Downloading {directory} to {dest_dir}")
cmd = f"""wget --quiet --show-progress \
--no-parent --recursive \
--reject "index.html*" \
--directory-prefix={DOWNLOAD_DIR} \
--no-host-directories \
--execute robots=off \
--continue \
{url}/{directory}/"""
subprocess.run(cmd.split())
cmd = f"""wget --quiet \
--show-progress \
--no-parent \
--recursive \
--reject "index.html*" \
--exclude-directories="IMG/distant" \
--directory-prefix={DOWNLOAD_DIR} \
--no-host-directories \
--execute robots=off \
--continue \
{url}/{directory}/"""
cmd = ' '.join(cmd.split()) # Remove duplicated spaces
print(f"Downloading {directory} to {dest_dir} using command line:\n{cmd}")
subprocess.run(cmd, shell=True) # shell=True is required to avoid " expansion
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment