Inspired/motivated by your guidance above, I created this simple file - which can be included part of the workspace (I have named it Save_your_workspace.ipynb).
The only thing that will change in the script below is the filename. Some one could easily do a find and replace for that course/week/assignment.
#BEGIN
!tar -czf C5W1A3.tar.xz *
file_data = !ls -l C5W1A3.tar.xz
file_size = int(file_data.s.split()[4])
print(file_data)
if file_size > 50*1024*1024:
!split -b 50m C5W1A3.tar.xz C5W1A3.tar.part.
print("As the file size is > 50 MB, the file has been split into parts. Look for file names with *part* and download them individually.")
else:
print("Your workspace has been saved into C5W1A3.tar.xz. You may download the same.")
#END
I hope I am not violating the coursera honor code here as this is a very generic code (nothing technical). Please feel free to remove if it does violate. I am just trying to add my 2 cents here.
I used this for the first week’s assignments of course 5