

# tar cvzf - /It is also possible to dump backup to remote tape device: You can also use dd command for clarity purpose: You can read more about tape drives naming convention used under Linux here. The default first SCSI tape drive under Linux is /dev/st0.

$ ssh 'tar czf - /home/vivek' | tar xvzf -C /home/vivek Use tar command through network over SSH session for tape device Open the terminal on x230 laptop and run the ssh command along with tar command: The problem with scp and other command copying the directory structure is that Symbolic links, special devices, sockets, named pipes, and other stuff not copied. # ssh 'dd if=prod-disk-hostname-sdvf-dd-mm-yyyy.img' | dd of=/dev/sdvf Moving data to a new Linux system For instance, we can restore a local hard disk drive from the image stored on the remote AWS EC2 cloud backup server as follows: To restore a local drive from the image on the server, reverse the command. # dd if=/dev/sdvf | ssh 'dd of=prod-disk-hostname-sdvf-dd-mm-yyyy.img' Let us copy the entire hard disk drive named /dev/sdvf from local machine to the remote AWS EC2 cloud backup server: $ ssh 'tar zcf - /some/dir' | tar zxf - Linux system hard drive backup/mirror using tar and ssh # tar zcvf - /Use of tar command over ssh sessionsĬopying from the remote machine () to local system is as follows: To avoid this problem pass the -t option to the ssh command: Sudo: sorry, you must have a tty to run sudo Please note that you may get an error that read as follows with ssh command when using with sudo or any other command that needs a pseudo-terminal allocation: $ tar zcf - /data2/ | gpg -e | ssh 'cat - > .gpg'

#Ssh copy remote file to local archive
In this example archive /data2/ with gpg: # tar zcvf - /Sample outputs: tar: Removing leading `/' from member names The following command backups /(IP 192.168.1.201) host over ssh session: $ ssh 'cd /dir1/ & tar -cf - file | gzip -9' > Get commands to copy the files.The syntax is as follows to ssh into box and run the tar command: You can also use ssh tunnels for running Screen Sharing as well You could also consider using MacFUSE and use an sshfs file system, so you can use the Finder but be transferring your files over an ssh connection.Īs MrHoffman has mentioned, you can create an ssh tunnel over which you can mount the remote system's volumes But if you are going to try and keep some files or directories in sync, then rsync is an ideal tool for this. You can also use the 'rsync' command, however, it is a bit more difficult to setup. Scp -p /path/to/local/file -r -p /path/to/local/director -r -p /path/to/local/Application.app scp Using scp (a very handy, and easily scriptable command: I don't use that too much so don't remember how it plays with quotes on filenames with spaces or whether you just have to "escape" the white spaces Lcd to navigate to the desired remote and local directories and then use (the trailing period here means the current local directory) But in the remote filename specification, you have to enclose the whole remote piece in double quotes AND escape the white spaces, like so: You can either enclose the whole local piece in quotes or "escape" the white spaces with a preceding backslash on the local end. Things get a little trickier if the filepath or filename have spaces in them. Similar with remote filepath, if the remote source file or target destination is at $HOME, no need for it. Local filepath is optional, if you're already in that directory, no need for it. If you want to change the name at the receiver, just append the target filename after the trailing slash. These two forms will retain the same filename at the receiver. Scp filepath/filename push a file to the remote machine, or If you like "old school" command line, then, (do a find on Unassigned - there's lots of them) It just can't belong to another service that is currently in use so I always choose a number that is "Unassigned" from You can use pretty much any number you like in place of theĥ0548 they just gotta match in both places. It will mount as an external volume on your desktop and you can drag and drop. Ssh -L50548:localhost:548 you have a user prompt from your remote machine displayed, then switch to Finder and ⌘k toĪfp://localhost:50548. On the local machine, launch Terminal.app and type You could have AFP drag and drop capability tunneled through ssh.
