A more efficient scp /cpio one liner
Is there a shorter way to pass a scp copy from a remote site locally and then pass it into cpio?
Code:
scp -Crp root@192.168.0.131:/var/backups/ /home/testuser/Downloads/extract/;find /home/testuser/Downloads/extract/backups | cpio -oavc > /home/testuser/Downloads/extract/testbackup.cpio |
Code:
ssh root@192.168.0.131 "find /var/backups | cpio -oavc" > /home/testuser/Downloads/extract/testbackup.cpio |
awesome but will this scp the backups directly through cpio and then to the 1T media?It is a big backup and I dont have much space where the script will run from to store the files temporarily. Everything would need to occur on the 1T external drive.
So Code:
scp -Crp testuser@192.168.5.1:/var/www/ --> cpio -oavc > /media/1T-drive/www/fullwwwsite.cpio |
i tested it and it worked awesomely. many thanks man
|
You're welcome!
As you already noticed, on the remote machine it writes to the standard output (no disk space required) and it redirects into a local cpio file. |
All times are GMT -5. The time now is 01:37 AM. |