WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Any backup extensions available ?  (Read 2819 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Any backup extensions available ?
« on: February 18, 2013, 07:39:31 PM »
Hi all,

Are there any extensions in microcore 3.8.4 that allow me to setup a backup ?

- Backup will be to 1TB ext usb hard drive.
- Would be handy if I could just plug the drive in, and have the backup take place without any other input (The staff who does the offsite backup is not linux literate).
- Would be great if the backup software sent a email on backup fail/sucess.

Opinions and comments welcome.
Live long and prosper.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Any backup extensions available ?
« Reply #1 on: February 18, 2013, 10:08:53 PM »
There are lots of packages that can be used to do backups:
rsync, tar, cpio, dd etc.
Since Core is meant to be a tool kit, you can use any of the above.
Personally, I like rsync for that kind of backup.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Any backup extensions available ?
« Reply #2 on: February 19, 2013, 12:28:42 AM »
Thanks gerald_clark,

I have found examples of using rsync and scripts to do a backup and email a log file as an attachment, will look into that. Can mc send mail via smtp with attachments, or will I have to use mutt or something else.

Found this
http://yarbu.sourceforge.net/
It looks like a handy program, and has email notification as well.
I'll see if I can get it to compile on mc and if its good, will submit it as an extension.
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Any backup extensions available ?
« Reply #3 on: February 19, 2013, 12:41:51 AM »
Hi remus
This may be of some use as a basic template for detecting, mounting, and unmounting the drive:
Code: [Select]
#!/bin/sh

DRIVE=""
while [ -z "$DRIVE" ] # Wait for device to be plugged in
do
DRIVE=`blkid -U 6b92c5e1-f49e-480e-87a0-8c1391a873c6 | cut -c6-9`
sleep 2
done
DEST=/mnt/$DRIVE
while [ ! -e "$DEST" ] do; sleep 2; done  # Wait for mount point to be created
ERROR=`mount $DEST`
if [ -n "$ERROR" ]
then
echo "Mount command failed and returned the following error:"
echo $ERROR
echo "Backup was not performed"
exit
fi

echo "Starting backup now. Do not unplug the drive"

#-------------Insert backup commands here ----------------------


#---------------------------------------------------------------

umount $DEST
echo "Backup complete. It is now safe to unplug the drive"

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Any backup extensions available ?
« Reply #4 on: February 19, 2013, 01:09:27 AM »
For emailing the status/log there's always mailx.tcz.
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

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Any backup extensions available ?
« Reply #5 on: February 19, 2013, 07:26:42 PM »
Thanks for the tip about mailx.tcz Lee

Thanks for the script template Rich :)
Live long and prosper.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Any backup extensions available ?
« Reply #6 on: February 19, 2013, 08:42:01 PM »
Hi remus
You are welcome. If you decide to make use of the script, replace  6b92c5e1-f49e-480e-87a0-8c1391a873c6  with
the UUID of your backup drive. The variable  $DEST  will point to the root of your backup drive, ie.  /mnt/sda3