WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: code to get your tcz folder  (Read 1677 times)

aus9

  • Guest
code to get your tcz folder
« on: February 14, 2013, 07:47:51 AM »
Hi

I am a simple coder

this kind of works as I need to download a package (tce-load -w cups)
find out where that package is with
Code: [Select]
TCE1=`cat /etc/sysconfig/backup_device`
# now use
cp /mnt/$TCE1/optional/cups.tcz /tmp

is this acceptable?

I know what to do when its there, I am just looking for any gotchas

« Last Edit: February 14, 2013, 07:51:32 AM by aus9 »

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: code to get your tcz folder
« Reply #1 on: February 14, 2013, 08:58:28 AM »
While the default is to have the backup stored in the tce directory, it is not a given that the backup device and tce directory will always be the same.

On recent releases of Core, use
Code: [Select]
cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp

/etc/sysconfig/tcedir is a symbolic link to your actual tce directory, wherever that might be.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

aus9

  • Guest
Re: code to get your tcz folder
« Reply #2 on: February 14, 2013, 06:53:48 PM »
excellent!

atm it now looks like
Code: [Select]
mkdir /tmp/cupsunpack

if [ ! -f /etc/sysconfig/tcedir/optional/cups.tcz ] ; then
tce-load -w cups
cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp/cupsunpack
else cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp/cupsunpack
fi

the unsquashing is done later and can be outside the if then
« Last Edit: February 14, 2013, 07:09:59 PM by aus9 »