Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would change this to:

tar czf - . | ssh destination "cd /remote/dir; tar xz"



You will one day punch yourself for not being safe.

    tar czf - | ssh destination 'cd /remote/dir && tar xzf -'
Test that `cd` or one day you'll end up extracting in the wrong place.


There is also tar -C /local/dir -czf - . | ssh dest "tar -C /remote/dir -xz"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: