0

The use case I am in mind is to make a backup of some data. I would like to create a tar file, mainly because there are tens of thousands of small files.

I use a cloud storage service which basically will keep polling the files on the hard drive to know when new files should be uploaded to the server. The files to back-up are on a Linux server, while the storage service has Windows client. Files from Linux server to Windows machine are shared using Samba. The service has a Linux client, which is compiled for x86 and can't be run on my server, as I use Raspberry Pi, which is ARM-based. The service is Asus Web Storage

Is there a way to create a virtual tar file, which will not be written to disk, for example, using fuse?

Or any other simple solution?

Paolo
  • 101
  • 3
  • I know one possibility would be to just create the tar file or pick a storage service that has better Linux support. I was wondering if some better solution may exist. – Paolo Mar 02 '20 at 12:55

1 Answers1

1

There are at least two solutions that comes to my mind:

1 - Use a ramdisk

For example :

mkdir /media/backupramdisk
mount -t tmpfs -o size=512M tmpfs /media/backupramdisk

You can then create a tar in this ramdisk, then you can transfer this file to a remote system.

I hardly see a benefit of doing that except that it won't take space on storage device, but it will take RAM. According to the resources available on your machine, you'd better create a real tar on disk.

2 - Tar to stdout

The output of tar can be directly transmitted over network. For example over ssh:

tar zcf - /dir/to/backup | ssh user@remoteserver "cat > /backup/backup.tgz"

Pros: no RAM and no disk space used.

Not knowing what you would like to do with the backup I can't elaborate much more. I hope this still helps.

rolf82
  • 136
  • 2