在Jupyter Notebook服务器上的路径中下载所有文件 [英] Download all files in a path on Jupyter notebook server

查看:2416
本文介绍了在Jupyter Notebook服务器上的路径中下载所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为运行Jupyter笔记本进行作业的类中的用户,我可以通过Web界面访问作业.我假设这些分配存储在服务器上我的个人空间中的某个位置,因此我应该能够下载它们.如何下载个人用户空间中的所有文件? (例如,wget)

As a user in a class that runs Jupyter notebooks for assignments, I have access to the assignments via the web interface. I assume the assignments are stored somewhere in my personal space on the server, and so I should be able to download them. How can I download all files that are in my personal user space? (e.g., wget)

这是路径结构:

https://urltoserver/user/username

有几个目录:分配,数据等.

There are several directories: assignments, data, etc.

https://urltoserver/user/username/assignments

https://urltoserver/user/username/data

...

我想(递归)下载所有文件夹.足够我可以在本地启动任何在线查看的内容.如果有一些禁止的文件夹,那么好的,请跳过这些文件夹并下载其余的文件夹.

I want to download all the folders (recursively). Just enough that I can launch whatever I see online locally. If there are some forbidden folders, then ok, skip those and download the rest.

请准确指定命令,因为我自己也不知道(我尝试了wget)

Please specify the command exactly as I couldn't figure it out myself (I tried wget)

推荐答案

尝试在一个笔记本中将其作为单独的单元运行:

Try running this as separate cell in one of your notebooks:

!tar chvfz notebook.tar.gz *

如果要在树上覆盖更多文件夹,请对目录的每一步在*之前写../.文件 notebook.tar.gz 将保存在与笔记本相同的文件夹中.

If you want to cover more folders up the tree, write ../ before the * for every step up the directory. The file notebook.tar.gz will be saved in the same folder as your notebook.

这篇关于在Jupyter Notebook服务器上的路径中下载所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆