1

I would like to create a .tar backup of some files on my laptop and send them to my server. My laptop's HDD is not large enough to hold both the original and backup copy of the file. I would like to break the tar archive into 10GB pieces.

Here's what I have so far:

tar cvf - /backupdir/ | ssh user@host "split -b 10G -d backup.tar."

And the result is

split: cannot open 'backup.tar.' for reading: No such file or directory

Of course, I could just tar | ssh "cat > backup.tar" and then open an SSH shell and split the file then, but I want to be fancy and do this all in one fell swoop.

2
  • 1
    you've got an extra . after your backup.tar Commented Dec 8, 2013 at 0:30
  • @Thom Wiggers: The split manpage says split takes the following form: split [OPTION] [INPUT [PREFIX]] there's an extra period because I would like my files to be named backup.tar.00 and so on.
    – curios
    Commented Dec 8, 2013 at 3:22

1 Answer 1

1

You need to tell split to read from STDIN.
The following should work:

tar cvf - /backupdir/ | ssh user@host "split -b 10G -d - backup.tar"

Hope that helps.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .