0

I have a Cassandra node with snapshots broken up into 64 directories with over 350 files per directory. I want to "find" all snapshot files, preserve their location, rsync them across to a host with lots of file space, and then tar/gz them when then land there. Is this possible in one step?

Currently I have to:

find /mnt* -type d -name snapshots -exec /usr/bin/rsync {} -avhr user@host:/mntc/backups/ ';' 

Then:

tar -czpf /mntd/backups/mybackup.tgz /mntc/backups/snapshots 

It would be nice to do something that would "pour" the files found directly into an archive on the other end during the rsync process. Is this possible?

NOTES:

  1. Cassandra nodes do not have required 1Tb of free space to pre compress files in find search
  2. Rsync of files to new host and then tarballing results requires 2Tb on host, reducing the number of Cassandra nodes I can do at a time (20 in total require backup)

1 Answer 1

0

So long story short, this is the best way I have found to achieve this, in case someone else is interested:

find /mnt* -type d -name snapshots > dir.list; \ tar -czpf - -T dir.list | ssh user@host "openssl aes256 \ -out /mntc/backups/snapshot.tgz.enc -salt -k 'secret'" 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.