2011年11月19日星期六

tar with /

When I try to tar -jcvf /, that will caused error
tar: Removing leading `/' from member names

The fix coomand
tar -jcvPf /opt.tar /opt
If you put the P after f, it will create P file...

untar tar -jxvPf /opt.tar if no P option, it will have the error as the same.

#!/bin/bash
DATE=`date "+%F-%H-%M"`
/u01/postgres/9.0/bin/pg_dump reviewdb > /var/backup/reviewdb_$DATE.sql
/usr/bin/bzip2 /var/backup/reviewdb_$DATE.sql
find . -name "*.sql.bz2" -mtime +90 -exec rm -rf {} \;

没有评论: