Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'One-step backup and burn to CD/DVD' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One-step backup and burn to CD/DVD
Authored by: P3Consulting on May 24, '04 04:52:33AM

You could improve a little bit by automatizing saving of any invisibles files in your home directory, making you bullet proof to further installs (.ssh, .gnupg, etc).
This little snippet save every invisible files/folders in your home folder (except .DS_Store and .Trash... - make change to/add grep filters to fit your needs)
[code]
#!/bin/sh

# between [] in below grep command are only <SPACE> and <TAB>
# the two grep -v "^... are there to avoid archiving of $HOME/. and $HOME/..
{
ls $HOME/.* | grep "/Users" | grep -v "Trash" | grep -v "DS_Store" | awk -F: '{ print $1 ; }' | grep -v "^[ ]*$HOME/.[ ]*$" | grep -v "^[ ]*$HOME/..[ ]*$"
} > /tmp/invisibles 2> /dev/null

#use archive tool of yout choice (tar, hfstar, gnutar, ...)
tar -zcf PUT_YOUR_ARCHIVE_FILE_NAME_HERE.tar.gz -T /tmp/invisibles
[/code]



[ Reply to This | # ]
One-step backup and burn to CD/DVD
Authored by: eagle on May 24, '04 01:45:25PM
That could be further simplified:

tar -czf PUT_YOUR_ARCHIVE_FILE_NAME_HERE.tar.gz `ls -d ~/.??* | grep -v Trash | grep -v DS_Store`

But both this one and yours would prepend /Users/username to the file listing, which may be undesirable. If that is not desired, the following might be better:

#!/bin/sh
chdir ~
tar -czf PUT_YOUR_ARCHIVE_FILE_NAME_HERE.tar.gz `ls -d .??* | grep -v Trash | grep -v DS_Store`


[ Reply to This | # ]

preserving resource forks
Authored by: sjk on May 25, '04 07:05:03PM

Not a great solution if you want to preserve resource forks and/or Finder comments. It's pretty likely that at least one file in ~/Library/Preferences has a resource fork and removing it (by restoring from a tar archive) might cause an application to fail or misbehave.



[ Reply to This | # ]
preserving resource forks
Authored by: P3Consulting on May 26, '04 03:23:26AM

to preserve resource forks, you could use hfstar... (available at http://www.metaobject.com/downloads/macos-x/)



[ Reply to This | # ]
preserving resource forks
Authored by: sjk on May 26, '04 10:44:36AM
Or hfspax. I had trouble with it and/or hfstar not handling >2GB archive files but that was a couple years ago and I don't recall the details.

[ Reply to This | # ]