[Level 1] Backup directories by cpio.

#!/bin/bash
source=$1
target=$2
(cd $source; find . -print | cpio -ocv) | (cd $target; cpio -icuvd)
# cd $source; find . -print | cpio -ocv > /tmp/tmp.cpio
# cd $target; cpio -icuvd < /tmp/tmp.cpio
Wish this helps.
regards,
Stanley Huang

Comments

Popular posts from this blog

[Level 2] Shell Interactive With Zenity Episode 5 -- list

[Level 2] iif in Python