|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Auto backup
I'd like to run a script once a week to backup /root, /usr and /var. I'd also like to tar those dump files. If I run the following script what do I need to add to it to compress the dump files? Also, will the dump commands run one after another or do I need something to start each one?
#!/bin/sh mount /dev/d0s1 /mnt/usb dump -0au -L -f /mnt/usb/usr.ad0s1f.dump /usr dump -0au -L -f /mnt/usb/var.ad0s1d.dump /var dump -0au -L -f /mnt/usb/root.ad0s1a.dump / #end |
|
||||
tar doesn't compress files, it just archives them.
For compressiong, use an application such as gzip(1), bzip2(1), or p7zip(1). gzip and bzip2 read from the standard input, not sure about p7zip. # dump -0auf- -L /usr | gzip > /mnt/usb/usr.ad0s1f.dump.gz
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
The bzip2 worked great. thanks.
|
|
||||
Restoring
What would be the correct way to then restore a backup made with this?
Code:
dump -0Lauf - /usr | bzip2 >/mtn/usb/usr.ad0s1f.dump.bz2 Code:
newfs /dev/ad0s1f mount /dev/ad0s1f /usr cd /usr bzcat usr.ad0s1f.dump.bz2 | restore -rf - |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
backup freeBSD 7.0 using Backup Exec | ccc | FreeBSD General | 2 | 25th April 2009 09:23 PM |
auto restart an app within wine | hamba | General software and network | 3 | 25th November 2008 11:56 AM |
Auto-YES? | wubrgamer | FreeBSD Ports and Packages | 7 | 24th September 2008 01:58 PM |
DSL auto login | Weaseal | FreeBSD General | 3 | 17th June 2008 03:26 PM |
Customizeable FTP auto-fetch script (OpenBSD snapshot download as example) | J65nko | Guides | 2 | 1st June 2008 03:29 AM |