WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: filetool.sh tar instead of tgz (as an option)  (Read 1740 times)

Offline rhalff

  • Newbie
  • *
  • Posts: 3
filetool.sh tar instead of tgz (as an option)
« on: January 30, 2013, 09:11:25 PM »
Hi People,

SS=/

I modified some files to allow for tar backup (which is faster as tgz, yet applies almost no compression).
I can imagine use cases where storage size is not so much of a problem and packing / extraction speed will be a benefit.

I've chosen to add SSetcSSsysconfigSSbackup_fmt to specify whether you want "tar" or "tgz" as your backup format.

However, since we have a chicken and egg problem here, to fully apply the change the initrd image should be updated (because that's where filetool.sh tc-restore.sh etc. resides).

I have added the changes in the attachment, just use the diff tool against the original files to see what I have changed.

(I had some more post content, but somehow this forum thinks I'm posting external links while pasting source code (within code tags))

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: filetool.sh tar instead of tgz (as an option)
« Reply #1 on: January 31, 2013, 07:19:16 AM »
have you actually measured it?

Offline rhalff

  • Newbie
  • *
  • Posts: 3
Re: filetool.sh tar instead of tgz (as an option)
« Reply #2 on: January 31, 2013, 07:25:45 AM »
Yeah I did:

time ./filetool.sh -b
Backing up files to /mnt/sda1/tce/mydata.tar
real    0m 17.82s
user    0m 0.03s
sys     0m 0.14s

time /usr/bin/filetool.sh -b
Backing up files to /mnt/sda1/tce/mydata.tgz
real    0m 36.07s
user    0m 27.99s
sys     0m 0.16s

 ls -lh /mnt/sda1/tce/mydata.*
-rw-r--r--    1 root     root       68.5M Jan 30 15:37 /mnt/sda1/tce/mydata.tar
-rw-r--r--    1 root     root       20.8M Jan 30 15:38 /mnt/sda1/tce/mydata.tgz

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: filetool.sh tar instead of tgz (as an option)
« Reply #3 on: January 31, 2013, 07:34:21 AM »
Interesting. and I have to say you have quite a big backup!

-rwxrwxrwx 1 tc staff 3.1M Jan 31 11:15 /mnt/sdb1/mydata.tgz

tc@x200:~$ time filetool.sh -b
Backing up files to /mnt/sdb1//mydata.tgzDone.
real   0m 2.11s
user   0m 0.70s
sys   0m 0.05s

my tgz:   1.5M/s
your tgz: 0.6M/s
your tar: 3.8M/s

different media and how capable your cpu is might make big differences here.
« Last Edit: January 31, 2013, 07:37:30 AM by hiro »

Offline rhalff

  • Newbie
  • *
  • Posts: 3
Re: filetool.sh tar instead of tgz (as an option)
« Reply #4 on: January 31, 2013, 07:45:08 AM »
It's just that big because I tar my home dir.

Ah well, no idea if there are use cases for this, maybe somebody finds it useful.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: filetool.sh tar instead of tgz (as an option)
« Reply #5 on: January 31, 2013, 08:20:08 AM »
Note that those numbers without knowledge of circumstances mean little regarding comparison.
If you do 2 consecutive backups, and then another one after doing "sudo cache-clear", the latter may take a multiple of time of the preceeding one, due to not making use of cached data.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)