C4_W3 - problem downloading the workspace

I have a problem downloading a workspace (notebooks and data) through terminal for Week 3 Lab 2.

when I try to create an archive with the following command:
tar -czf ~/workspace.tar.gz ~/work
I get this error:
tar: Removing leading /’ from member names`

tar: /root/work: Cannot stat: No such file or directory

tar: Exiting with failure status due to previous errors

All the time before it worked (following coursera instructions ).
Also I noticed that in the terminal the line should start from jovyan@numbers:~/work$ where in this lab it starts from #

Any suggestions ?
Many thanks in advance

Hey, I got the same error yesterday. Refer to the below steps to download the entire workspace

  • Open up the coursera notebook, and select the ‘Open…’ option from the File menu.
  • Navigate to the directory where you can find a single folder containing all the files.
  • Select the New option and open a new Terminal.
  • Use the ls and cd commands to make sure you are in the right directory.
  • Once you are in the same directory as that of the folder, use>

tar -czf arch.tar.xz <folder_name>

  • You can find the tar file in the same directory as that of the folder, which can be easily downloaded.

!tar chvfz …/arch.tar.xz *
!split -b 50m …/arch.tar.xz …/allfiles.tar.gz.part.

1 Like

Hello @Elemento

Thanks for the quick reply !

I could not navigate through ls and cd in terminal, but I could create small .gz archives following the stackoverflow link you provided and it worked.

I am able to download that but so far did not find a way to open it and unzip… I am on Linux system. but not a linux superuser lol)

Refer to this link to install 7zip on Linux

Once installed, you can just follow the commands posted in this article to combine all the tar files into a single file, and then de-compress it simply using the Archive Manager

If you’re on linux, then you don’t need anything optional like 7Zip. “tar” is a native linux command. The trick is that you’ve done “split”, right? So first you have to reassemble the pieces into a unified “tar gz” file. It doesn’t require superuser rights: you’re just manipulating files you own.

cat allfiles.tar.gz.part.* > fullfile.tar.gz
tar xzvf fullfile.tar.gz

Or if you really want to get crazy you can do it with a pipeline:

cat allfiles.tar.gz.part.* | tar xzvf -

2 Likes

Wow, thank you so much, that worked perfectly ! I don’t know bash so you saved me hours of figuring that out, many thanks @paulinpaloalto
by the way with 7Zip that did not worked

I’m glad to hear that those instructions were enough to get you there. I guess I’m an old fashioned linux user: I don’t understand the point of using linux if you don’t know the “shell”. That’s what is so great about it. :nerd_face: Well, that and the fact that it’s free. And it’s not Windows. Although even Micro$oft now includes Ubuntu as a standard supported part of Windows 10.

2 Likes

to understand it one day :wink:

exactly !

that is funny)

7z e allfiles.tar.gz.part.aa seems to work for me always. Make sure that you have 7z correctly installed and are in the same directory as that of your zip files. But why to install an extra package, when you can do with the already available ones :innocent:

@Elemento Exactly ! )

Hi,

what if you are running on windows? I tried the above instruction but apparently “tar” is not a known function for the system. please see the error message below.

Best regards

jovyan@30dee9bc08ba:~/work/W4A1$ !tar chvfz …/arch.tar.xz *
tar chvfz …/arch.tar.xz * chvfz …/arch.tar.xz *
tar (child): …/arch.tar.xz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
C5_W4_A1_Transformer_Subclass_v1.ipynb
tar: …/arch.tar.xz: Cannot write: Broken pipe
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Hey @AffDk the basic commands differ in a Windows and Linux System as you already might know, so it is highly probable that these commands may not work. But I guess there are tools that you can use on Windows to perform the same job. I guess WinRAR is one of them! I hope this helps

Hi,
thanks for your feedback. I actually managed to do it finally.
I followed the instructions in the following page:

I also noticed that there was a typo in their instructions, so I ended up using the following two commands:

tar -czf - ~/work | split --bytes=100MB - ~/workspace.tar.gz   
mv ~/workspace.tar.gz* ~/work/    

and I also used 7-zip on windows. I selected all files in windows explorer and then from 7-zip menu appearing with right click, chose Extract to “*\”

so it worked in the end.

Aff

2 Likes

I manage to create a zip file of W3A2 folder. However I can’t download it. Can anybody help me?

The tar archive needs to be split into 100MB pieces.

1 Like

Right! You can see an example of how to use the “split” command for that purpose shown in one of the previous posts on this thread.

One other thing to note is that the 100MB “chunk size” is situational. That number is not guaranteed to work for everyone, because it depends on your ISP and other properties of your network setup. I’ve heard some people had to go as low as 50MB for the “split” size in order for the chunks to be individually downloadable. Start with 100MB though and see if that works …

1 Like

Thanks @jonaslalin and @paulinpaloalto!