> What is the easiest way to move a large number of worksheets (~100) to > another machine? > > Or to ask the question another way, how do you guys make backup copies > of your work?
I have a subdirectory called "Backups" in my home directory and run the following bash shell command (actually, it's in my crontab): cd ~/Backups/ && mkdir sage_notebook.`date +\%Y.\%m.\%d` && cd sage_notebook.`date +\%Y.\%m.\%d` && for x in ~/.sage/sage_notebook/ worksheets/admin/*/worksheet.txt ; do mkdir "`echo "$x" | sed 's/[^0-9] *\([0-9][0-9]*\)\/worksheet\.txt/\1/g'`" ; done && for x in ~/.sage/ sage_notebook/worksheets/admin/*/worksheet.txt ; do cd "`echo "$x" | sed 's/[^0-9]*\([0-9][0-9]*\)\/worksheet\.txt/\1/g'`" ; cp "$x" . ; cd .. ; done && for x in */worksheet.txt; do y=`echo "$x" | sed 's/\ ([0-9][0-9]*\)\/worksheet\.txt/\1/g' | sed 's/^[0-9]$/0&/g'` ; z=`head -n1 "$x"` ; echo "$y $z" >> contents.txt ; cat contents.txt | sort > contents.txt ; done && cd .. && tar -cf sage_notebook.`date +\%Y.\%m.\ %d`.tar sage_notebook.`date +\%Y.\%m.\%d` && bzip2 sage_notebook.`date +\%Y.\%m.\%d`.tar && /bin/rm -r sage_notebook.`date +\%Y.\%m.\%d` William's solution is obviously simpler (and betrays less neurosis about economizing on disk space). If I've understood him correctly, I'm not losing anything vital by discarding all but the worksheet.txt files. For other UNIX shells you might need to change the syntax slightly, and if you have more than 100 sage worksheets, you might want to edit the "sed 's/^[0-9]$/0&/g'" command. Sincerely, Greg ------------------------------------------------ | Greg Marks | | Department of Mathematics and Computer Science | | St. Louis University | | St. Louis, MO 63103-2007 | | U.S.A. | | | | Phone: (314)977-7206 | | Fax: (314)977-1452 | | Web: http://math.slu.edu/~marks | ------------------------------------------------ On Apr 14, 4:25 pm, William Stein <wst...@gmail.com> wrote: > On Tue, Apr 14, 2009 at 1:45 PM, photonn <wdbr...@gmail.com> wrote: > > > What is the easiest way to move a large number of worksheets (~100) to > > another machine? > > There is no easy way to do that, except... that this morning robert > Bradshaw implemented > a way to do this: > > http://trac.sagemath.org/sage_trac/ticket/2740 > > > > > Or to ask the question another way, how do you guys make backup copies > > of your work? > > I would backup the entire sage notebook state directory, which by default is > > $HOME/.sage/sage_notebook > > William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---