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)
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'"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.