[Tip] tar 절대경로 파일 → 상대경로로 풀기
pax -r -s ',^/usr/local/secuplatesm/procsvr/cron,ps_cron_test/test,' -f ps_cron.tar
pax -r -s ',^//기존경로///,///풀 경로///,' -f 파일명.tar
pax -r -s ',^/,,' -l -p e -f 해당file.tar
- 풀 경로에서 실시하게되면 해당 디렉토리부터 절대경로 디렉토리로 압축 해제
[v480:/tmp/svr/tar_test]#tar tvf *
tar: blocksize = 11
-rwxr-xr-x 0/0 2560 4월 9 16:08 2010 /tmp/svr/db.sh
-rwxr-xr-x 0/0 564 4월 9 11:03 2010 /tmp/svr/db1.sh
[pax -r -s ',^/tmp/svr/,/tmp/svr/1/,' -f test.tar ]
#########################################################
[root@VM 20190914]# tar tvf aaa.tar
-rw-r--r-- root/root 0 2019-09-17 21:58 /tmp/logfile/2019091400.log
-rw-r--r-- root/root 0 2019-09-17 21:58 /tmp/logfile/2019091401.log
# tar xvf aaa.tar --strip-components=2
drwxr-xr-x 2 root root 4096 9월 17 23:31 aaa
-rw-r--r-- 1 root root 20480 9월 17 23:22 aaa.tar
[root@VM]# ll
합계 0
-rw-r--r-- 1 root root 0 9월 17 21:58 2019091400.log
-rw-r--r-- 1 root root 0 9월 17 21:58 2019091401.log
-rw-r--r-- 1 root root 0 9월 17 21:58 2019091402.log