You could always mount the usb stick to that location

mount /dev/sda1 /var/lib/asterisk/backups/daily

this will "overlay" the existing directory and write to the USB stick

Once unmounted, it would write to the hard drive. The only caveat is that in order to access both locations at the same time, you would have to mount the usb stick to a different location.

Lastly, you could manually the ampbackup.pl script itself to save to a different directory, but htis may get overwritten in the next FreePBX update.

Martin

Henry L.Coleman wrote:
This looks good but I really want a backup and restore to/from the USB stick
as default
If the stick isn't there then it could default to the directory 
/var/lib/asterisk/backups/daily/


Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------



Mike Ashton<
Henry,

Make sure on your USB stick there is a directory called asterisk.
I'm assuming that your backups are here : /var/lib/asterisk/backups/daily/

Now take what is below and put in a file, make it executable and run as
root.

mount /dev/sda1 /mnt/usb
if [ -d /mnt/usb/asterisk ]; then
rsync -av /var/lib/asterisk/backups/daily/ /mnt/usb/asterisk/;
umount /mnt/usb;
exit 0
else
echo "Error: Could not mount storage device";
exit 2
fi

Using the rsync command will move anything that is not in the source
directory to the usb.

If this works then you can add this script to run after your back up.
Not sure in freePX but an also be run as a cron job.

Mike

Martin Glazer wrote:
I belive it would be /dev/sda1 and not just sda - sda1 is going to be
the first partition on the usb stick. You can think of it as a hard
drive with multiple partitions - the main drive is hda and then the
partitions are hda1, hda2, etc.

As far as seeing the files on the drive, before unplugging the usb
drive, you must first unmount it, otherwise the files may not be
written and closed correctly.

umount /mnt/usb

Is this something you are going to be doing regularly, or just when
needed (ie. manual or automated)?

Martin


Bill Sandiford wrote:
Exactly what Johannes said, but based on the output of your
/var/log/messages I think the second step will be

mount /dev/sda /mnt/usb


-----Original Message-----
From: Johannes Vanderknyff [mailto:[email protected]]
Sent: Tuesday, June 16, 2009 3:13 PM
To: [email protected]
Cc: [email protected]
Subject: Re: [on-asterisk] Backup and restore to a USB stick

Hmmm. Doesn't look like it is "mounted" yet. I just googled "linux how
to mount usb drive"...

Create the directory
  mkdir /mnt/usb
Next, mount the drive
  mount /dev/sda1 /mnt/usb
Then, see if it works:
  cd /mnt/usb
  ls
You should see a list of the files on your USB drive.

Johannes

On Tue, Jun 16, 2009 at 3:07 PM, Henry
L.Coleman<[email protected]> wrote:

This is what I get

r...@pbx:~ $ mount
/dev/hda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

-----------------
Henry L. Coleman
[VoIP-PBX.ca]

=================


Johannes Vanderknyff<
(NOTE: I don't know much about FreePBX)

If you can get to the console, type "mount" and that should give you a
listing of "mounted" filesystems.
If FreePBX mounted the USB drive, you'll be good to go and you can
just copy
(cp) the files to that location.

Johannes

On Tue, Jun 16, 2009 at 1:48 PM, Henry L.Coleman
<[email protected]>wrote:


Hi all, as many are aware FreePBX has a backup and restore
function that
can schedule a backup of conf, cdr, and vmail.
This works very well but I need to back the files up to a USB
stick instead
of a default backup directory.
My question (not being a good Linux man) is how do I the redirect the
backup path to this device.
When I plug the stick in, the consule indicates that the stick is
recognised and is working but does't tell me where
in the directory structure to find it.

Help please?

Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


--
Mike Ashton

Quality Track Intl
CTO
Ph:     647-724-3500 x 301
Cell:   416-527-4995
Fax:    416-352-6043

QTI CONFIDENTIAL AND PROPRIETARY INFORMATION

The contents of this material are confidential and proprietary to Quality Track 
 International, Inc.
and may not be reproduced, disclosed, distributed or used without the express 
permission of an authorized
representative of QTI.
Use for any purpose or in any manner other than that expressly authorized is 
prohibited.
If you have received this communication in error, please immediately delete it 
and all copies, and promptly notify the
sender.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to