Discussion:
Backup and restore to a USB stick
(too old to reply)
Henry L.Coleman
2009-06-16 17:48:49 UTC
Permalink
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]
-------------------------------------------------
Henry L.Coleman
2009-06-16 19:07:57 UTC
Permalink
This is what I get

***@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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
Johannes Vanderknyff
2009-06-16 19:12:44 UTC
Permalink
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
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Henry L.Coleman
2009-06-16 19:35:25 UTC
Permalink
Yes that works, but when I removed the stick it showed the file but could not (of course) access it
Plugging it back in again removed the file and showed an empty directory.

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

=================
Johannes Vanderknyff<
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
cd /mnt/usb
ls
You should see a list of the files on your USB drive.
Johannes
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Douglas Pickett
2009-06-16 22:30:45 UTC
Permalink
Henry,
Don't forget to do a umount (either of umount /dev/sda1 or umount /mnt/usb
should work). If it doesn't unmount, make sure that you've cd'ed out of
/mnt/usb and try again (umount won't work if the current directory of a
shell session or program includes the mounted filesystem).

If you just remove the usb stick without the umount bad things happen.

Regards,
Doug.

----- Original Message -----
From: "Henry L.Coleman" <asterisk-qOF+EEo2OLEsA/***@public.gmane.org>
To: <asterisk-***@public.gmane.org>
Sent: Tuesday, June 16, 2009 3:35 PM
Subject: Re: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
Yes that works, but when I removed the stick it showed the file but could
not (of course) access it
Plugging it back in again removed the file and showed an empty directory.
-----------------
Henry L. Coleman
[VoIP-PBX.ca]
=================
Johannes Vanderknyff<
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
cd /mnt/usb
ls
You should see a list of the files on your USB drive.
Johannes
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Bill Sandiford
2009-06-16 19:41:16 UTC
Permalink
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:johannes.vanderknyff-***@public.gmane.org]
Sent: Tuesday, June 16, 2009 3:13 PM
To: asterisk-qOF+EEo2OLEsA/***@public.gmane.org
Cc: asterisk-***@public.gmane.org
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
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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: asterisk-unsubscribe-***@public.gmane.org
For additional commands, e-mail: asterisk-help-***@public.gmane.org
Martin Glazer
2009-06-16 19:53:15 UTC
Permalink
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
Post by Bill Sandiford
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-----
Sent: Tuesday, June 16, 2009 3:13 PM
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
cd /mnt/usb
ls
You should see a list of the files on your USB drive.
Johannes
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Mike Ashton
2009-06-16 20:04:02 UTC
Permalink
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
Post by Martin Glazer
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
Post by Bill Sandiford
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-----
Sent: Tuesday, June 16, 2009 3:13 PM
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
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
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
--
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.
Henry L.Coleman
2009-06-16 20:29:27 UTC
Permalink
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
Post by Martin Glazer
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
Post by Bill Sandiford
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-----
Sent: Tuesday, June 16, 2009 3:13 PM
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
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
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
--
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.
---------------------------------------------------------------------
Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------
Martin Glazer
2009-06-16 22:10:40 UTC
Permalink
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
Post by Henry L.Coleman
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
Post by Martin Glazer
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
Post by Bill Sandiford
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-----
Sent: Tuesday, June 16, 2009 3:13 PM
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
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
Post by Henry L.Coleman
This is what I get
/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
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
--
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.
---------------------------------------------------------------------
Henry L.Coleman [VoIP-PBX.ca]
-------------------------------------------------
---------------------------------------------------------------------
Henry L.Coleman
2009-06-16 19:16:14 UTC
Permalink
Hi Bill as requested.....

Jun 16 15:00:24 pbx kernel: Vendor: Lexar Model: JD FireFly Rev: 1100
Jun 16 15:00:24 pbx kernel: Type: Direct-Access ANSI SCSI revision: 00
Jun 16 15:00:24 pbx kernel: SCSI device sda: 3915776 512-byte hdwr sectors (2005 MB)
Jun 16 15:00:24 pbx kernel: sda: Write Protect is off
Jun 16 15:00:24 pbx kernel: sda: assuming drive cache: write through
Jun 16 15:00:24 pbx kernel: SCSI device sda: 3915776 512-byte hdwr sectors (2005 MB)
Jun 16 15:00:24 pbx kernel: sda: Write Protect is off
Jun 16 15:00:24 pbx kernel: sda: assuming drive cache: write through
Jun 16 15:00:24 pbx kernel: sda: sda1
Jun 16 15:00:24 pbx kernel: sd 0:0:0:0: Attached scsi removable disk sda
Jun 16 15:00:24 pbx kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Jun 16 15:00:24 pbx kernel: EXT3 FS on hda2, internal journal
Jun 16 15:00:24 pbx kernel: kjournald starting. Commit interval 5 seconds
Jun 16 15:00:24 pbx kernel: EXT3 FS on hda1, internal journal
Jun 16 15:00:24 pbx kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jun 16 15:00:24 pbx kernel: Adding 779144k swap on /dev/hda3. Priority:-1 extents:1 across:779144k
Jun 16 15:00:24 pbx kernel: IA-32 Microcode Update Driver: v1.14a <tigran-***@public.gmane.org>
Jun 16 15:00:24 pbx kernel: NET: Registered protocol family 10
Jun 16 15:00:24 pbx kernel: lo: Disabled Privacy Extensions

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

=================
Bill Sandiford<
What is the exact message that comes up on the console when you insert it?
Does anything show up in /var/log/messages when you insert it?
Bill
-----Original Message-----
Sent: Tuesday, June 16, 2009 1:49 PM
Subject: [on-asterisk] Backup and restore to a USB stick
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]
-------------------------------------------------
---------------------------------------------------------------------
Douglas Pickett
2009-06-17 15:04:22 UTC
Permalink
Henry,
The quick answer on where to find mounted filesystems is "df" (which as the
man page states "report file system disk space usage").

Here's what a trixbox system reports:

# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 74842944 2522460 68457256 4% /
/dev/hda1 101086 11084 84783 12% /boot
tmpfs 253700 0 253700 0% /dev/shm
/dev/sda1 2002892 627960 1374932 32% /mnt/usb

The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where the
device is mounted onto the filesystem (in this case /mnt/usb).

As for redirecting the output of the backup (assuming you can't tell the
backup utility to change where it puts the backup) is to change the target
directory of the mount command, or put in a symbolic link. The freepbx
backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to the
backup name, and puts the actual backup file in that directory.

For the mount point idea, instead of mounting to /mnt/usb, you could do

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

This will hide any files and directories in that backups directory, and
replace them with the directory structure on the USB drive. When you umount
the USB stick they will re-appear.

You can also use a symbolic link:

ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily

This command creates a link in the backups directory called daily, that then
points to a directory on the USB drive. When you backup using the "daily"
config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be writing to
/mnt/usb/daily.

I think the best suggestion is to follow what Mike Ashton suggested with
rsync - you actually do the backups to the local hard drive, but then copy
the files over to the USB device. Given the limited number of write cycles
for USB flash memory, this is probably a good idea.

Regards,
Doug.



----- Original Message -----
From: "Henry L.Coleman" <asterisk-qOF+EEo2OLEsA/***@public.gmane.org>
To: <asterisk-***@public.gmane.org>
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
Mike Ashton
2009-06-17 15:41:17 UTC
Permalink
Henry,

Something to consider. If the purpose is to have a backup in case of
disaster recovery, you should really consider off site, not to a local
USB stick. Also if you are providing support services to clients there
is nothing worse then a system failure and no current backups for
recovery. I don't have remote client voip installations this but what I
do have is my own business servers at a colo that require backup.

What we do is have each server do it's backup locally, then after the
backup we utilize sftp and rsync to move any directories we want backed
up to be copied to a remote backup server. So if anything this could be
an added level of service you can provide to your clients! Extra revenue?

You can implement this a few ways, but here is a link which gives a good
explanation on doing it for a web site a mysql server.
http://www.howtoforge.com/mirroring_with_rsync

Another option is to use jungle disk, look here
http://www.jungledisk.com/howitworks.shtml

Just some ideas!

Mike
Post by Mike Ashton
Henry,
The quick answer on where to find mounted filesystems is "df" (which
as the man page states "report file system disk space usage").
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 74842944 2522460 68457256 4% /
/dev/hda1 101086 11084 84783 12% /boot
tmpfs 253700 0 253700 0% /dev/shm
/dev/sda1 2002892 627960 1374932 32% /mnt/usb
The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where
the device is mounted onto the filesystem (in this case /mnt/usb).
As for redirecting the output of the backup (assuming you can't tell
the backup utility to change where it puts the backup) is to change
the target directory of the mount command, or put in a symbolic link.
The freepbx backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to
the backup name, and puts the actual backup file in that directory.
For the mount point idea, instead of mounting to /mnt/usb, you could do
mount /dev/sda1 /var/lib/asterisk/backups
This will hide any files and directories in that backups directory,
and replace them with the directory structure on the USB drive. When
you umount the USB stick they will re-appear.
ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily
This command creates a link in the backups directory called daily,
that then points to a directory on the USB drive. When you backup
using the "daily" config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be
writing to /mnt/usb/daily.
I think the best suggestion is to follow what Mike Ashton suggested
with rsync - you actually do the backups to the local hard drive, but
then copy the files over to the USB device. Given the limited number
of write cycles for USB flash memory, this is probably a good idea.
Regards,
Doug.
----- Original Message ----- From: "Henry L.Coleman"
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
--
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.
Johannes Vanderknyff
2009-06-17 15:45:34 UTC
Permalink
And you can sell that as part of your services :) (Maintenance contracts, etc)

Johannes

On Wed, Jun 17, 2009 at 11:41 AM, Mike
Post by Mike Ashton
Henry,
Something to consider. If the purpose is to have a backup in case of
disaster recovery, you should really consider off site, not to a local USB
stick. Also if you are providing support services to clients there is
nothing worse then a system failure and no current backups for recovery. I
don't have remote client voip installations this but what I do have is my
own business servers at a colo that require backup.
What we do is have each server do it's backup locally, then after the backup
we utilize sftp and rsync to move any directories we want backed up to be
copied to a remote backup server. So if anything this could be an added
level of service you can provide to your clients! Extra revenue?
You can implement this a few ways, but here is a link which gives a good
explanation on doing it for a web site a mysql server.
http://www.howtoforge.com/mirroring_with_rsync
Another option is to use jungle disk, look here
http://www.jungledisk.com/howitworks.shtml
Just some ideas!
Mike
Henry,
The quick answer on where to find mounted filesystems is "df" (which as the
man page states "report file system disk space usage").
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2             74842944   2522460  68457256   4% /
/dev/hda1               101086     11084     84783  12% /boot
tmpfs                   253700         0    253700   0% /dev/shm
/dev/sda1              2002892    627960   1374932  32% /mnt/usb
The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where the
device is mounted onto the filesystem (in this case /mnt/usb).
As for redirecting the output of the backup (assuming you can't tell the
backup utility to change where it puts the backup) is to change the target
directory of the mount command, or put in a symbolic link.  The freepbx
backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to the
backup name, and puts the actual backup file in that directory.
For the mount point idea, instead of mounting to /mnt/usb, you could do
   mount /dev/sda1 /var/lib/asterisk/backups
This will hide any files and directories in that backups directory, and
replace them with the directory structure on the USB drive.  When you umount
the USB stick they will re-appear.
   ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily
This command creates a link in the backups directory called daily, that then
points to a directory on the USB drive.  When you backup using the "daily"
config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be writing to
/mnt/usb/daily.
I think the best suggestion is to follow what Mike Ashton suggested with
rsync - you actually do the backups to the local hard drive, but then copy
the files over to the USB device.  Given the limited number of write cycles
for USB flash memory, this is probably a good idea.
Regards,
Doug.
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
--
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.
---------------------------------------------------------------------
Elliott Jeyaseelan
2009-06-18 17:34:14 UTC
Permalink
Need to pick your brain folks, I am sure someone has tackled this
before.

I have a cyberdata voip paging amplifier. Its registered with Asterisk
as a SIP extension.

The voip amp automatically answers any incoming call and plays it to the
horn.

I have a scenario where there is an Intercom call box, someone pushes
the Call button, it rings a ring-group, I want the paging amp to play a
tone and other phones in the ring group to ring.

When one of the phones answers, I would like the paging amp to hang up.

Problem is, the paging amp being factory set to auto-answer, ends up
getting the call and none of the other phones in the ring group ever
ring, obviously nature of the ring group and the paging amp pickup the
call.

Any suggestions on how to go about implementing, I am using Freepbx,
hoping your suggestion is can be implemented on Freepbx.

Thanks.
Nabeel Jafferali
2009-06-18 18:13:24 UTC
Permalink
You will probably have to put them all into a conference room to do that.

--
Nabeel Jafferali
X2 Networks


-----Original Message-----
From: Elliott Jeyaseelan [mailto:guru-4YqG+***@public.gmane.org]
Sent: June-18-09 1:34 PM
To: asterisk-***@public.gmane.org
Subject: [on-asterisk] Paging question

Need to pick your brain folks, I am sure someone has tackled this
before.

I have a cyberdata voip paging amplifier. Its registered with Asterisk
as a SIP extension.

The voip amp automatically answers any incoming call and plays it to the
horn.

I have a scenario where there is an Intercom call box, someone pushes
the Call button, it rings a ring-group, I want the paging amp to play a
tone and other phones in the ring group to ring.

When one of the phones answers, I would like the paging amp to hang up.

Problem is, the paging amp being factory set to auto-answer, ends up
getting the call and none of the other phones in the ring group ever
ring, obviously nature of the ring group and the paging amp pickup the
call.

Any suggestions on how to go about implementing, I am using Freepbx,
hoping your suggestion is can be implemented on Freepbx.

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: asterisk-unsubscribe-***@public.gmane.org
For additional commands, e-mail: asterisk-help-***@public.gmane.org
Elliott Jeyaseelan
2009-06-18 20:26:23 UTC
Permalink
Can you share more on how that could help.

When a call originates from a sip intercom, I would like the paging
system to put out a tone, but when one of the sip phones answer that
call, I want the communication only between the originating Intercom
unit and the phone.....I don't want the paging system to be part of that
conversation etc.

The issue with the voip paging amp is that, it auto answers every
incoming call there is no options to turn it off.

In our case, we are not using the paging system for paging.

Any ideas you could share would be great, I think Andre's suggestion
seems to be closer to what I am trying to achieve.

Elliott
-----Original Message-----
Sent: Thursday, June 18, 2009 2:13 PM
Subject: RE: [on-asterisk] Paging question
You will probably have to put them all into a conference room
to do that.
--
Nabeel Jafferali
X2 Networks
-----Original Message-----
Sent: June-18-09 1:34 PM
Subject: [on-asterisk] Paging question
Need to pick your brain folks, I am sure someone has tackled
this before.
I have a cyberdata voip paging amplifier. Its registered with
Asterisk as a SIP extension.
The voip amp automatically answers any incoming call and
plays it to the horn.
I have a scenario where there is an Intercom call box,
someone pushes the Call button, it rings a ring-group, I want
the paging amp to play a tone and other phones in the ring
group to ring.
When one of the phones answers, I would like the paging amp
to hang up.
Problem is, the paging amp being factory set to auto-answer,
ends up getting the call and none of the other phones in the
ring group ever ring, obviously nature of the ring group and
the paging amp pickup the call.
Any suggestions on how to go about implementing, I am using
Freepbx, hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
---------------------------------------------------------------------
Nabeel Jafferali
2009-06-18 20:43:33 UTC
Permalink
If the paging speaker is only for the tone, then my answer does not apply.

Your best bet is then to follow Andre's suggestion and have your diaplan
generate a call-file that causes only the tone to be played to the paging
speaker.

--
Nabeel Jafferali
X2 Networks


-----Original Message-----
From: Elliott Jeyaseelan [mailto:guru-4YqG+***@public.gmane.org]
Sent: June-18-09 4:26 PM
To: Nabeel Jafferali; asterisk-***@public.gmane.org
Subject: RE: [on-asterisk] Paging question

Can you share more on how that could help.

When a call originates from a sip intercom, I would like the paging
system to put out a tone, but when one of the sip phones answer that
call, I want the communication only between the originating Intercom
unit and the phone.....I don't want the paging system to be part of that
conversation etc.

The issue with the voip paging amp is that, it auto answers every
incoming call there is no options to turn it off.

In our case, we are not using the paging system for paging.

Any ideas you could share would be great, I think Andre's suggestion
seems to be closer to what I am trying to achieve.

Elliott
-----Original Message-----
Sent: Thursday, June 18, 2009 2:13 PM
Subject: RE: [on-asterisk] Paging question
You will probably have to put them all into a conference room
to do that.
--
Nabeel Jafferali
X2 Networks
-----Original Message-----
Sent: June-18-09 1:34 PM
Subject: [on-asterisk] Paging question
Need to pick your brain folks, I am sure someone has tackled
this before.
I have a cyberdata voip paging amplifier. Its registered with
Asterisk as a SIP extension.
The voip amp automatically answers any incoming call and
plays it to the horn.
I have a scenario where there is an Intercom call box,
someone pushes the Call button, it rings a ring-group, I want
the paging amp to play a tone and other phones in the ring
group to ring.
When one of the phones answers, I would like the paging amp
to hang up.
Problem is, the paging amp being factory set to auto-answer,
ends up getting the call and none of the other phones in the
ring group ever ring, obviously nature of the ring group and
the paging amp pickup the call.
Any suggestions on how to go about implementing, I am using
Freepbx, hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: asterisk-unsubscribe-***@public.gmane.org
For additional commands, e-mail: asterisk-help-***@public.gmane.org
Andre Courchesne - Consultant
2009-06-18 18:24:24 UTC
Permalink
I did something similar for doing a page group on a failover for a queue
where a page would be sent out and the caller be put in an overflow queue.

The idea is to make a script that would create a callfile to do the
paging and at the "same time" send the caller to the ringgroup.

The callfile would go in a context that would do a page on your
cyberdata playing your tone.
Post by Elliott Jeyaseelan
Need to pick your brain folks, I am sure someone has tackled this
before.
I have a cyberdata voip paging amplifier. Its registered with Asterisk
as a SIP extension.
The voip amp automatically answers any incoming call and plays it to the
horn.
I have a scenario where there is an Intercom call box, someone pushes
the Call button, it rings a ring-group, I want the paging amp to play a
tone and other phones in the ring group to ring.
When one of the phones answers, I would like the paging amp to hang up.
Problem is, the paging amp being factory set to auto-answer, ends up
getting the call and none of the other phones in the ring group ever
ring, obviously nature of the ring group and the paging amp pickup the
call.
Any suggestions on how to go about implementing, I am using Freepbx,
hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
--
----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
MSN: courchea-***@public.gmane.org
Skype: VoipForces

L'information contenue dans le pre'sent document est la proprie'te' de
Andre Courchesne. Et est divulgue'e en toute confidentialite'. Cette
information ne doit pas e^tre utilise'e, divulgue'e a` d'autres personnes ou
reproduite sans le consentement e'crit explicite de Andre Courchesne.

The information contained in this document is confidential and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Elliott Jeyaseelan
2009-06-18 19:50:13 UTC
Permalink
Andre,

That sounds like what I am tring to achieve.

Not sure where to even start in Freepbx, but I am going to give it a try
etc.

Thanks for that idea...

Elliott
-----Original Message-----
Sent: Thursday, June 18, 2009 2:24 PM
To: Elliott Jeyaseelan
Subject: Re: [on-asterisk] Paging question
I did something similar for doing a page group on a failover
for a queue where a page would be sent out and the caller be
put in an overflow queue.
The idea is to make a script that would create a callfile to
do the paging and at the "same time" send the caller to the ringgroup.
The callfile would go in a context that would do a page on
your cyberdata playing your tone.
Post by Elliott Jeyaseelan
Need to pick your brain folks, I am sure someone has tackled this
before.
I have a cyberdata voip paging amplifier. Its registered
with Asterisk
Post by Elliott Jeyaseelan
as a SIP extension.
The voip amp automatically answers any incoming call and
plays it to the
Post by Elliott Jeyaseelan
horn.
I have a scenario where there is an Intercom call box,
someone pushes
Post by Elliott Jeyaseelan
the Call button, it rings a ring-group, I want the paging
amp to play a
Post by Elliott Jeyaseelan
tone and other phones in the ring group to ring.
When one of the phones answers, I would like the paging amp
to hang up.
Post by Elliott Jeyaseelan
Problem is, the paging amp being factory set to auto-answer, ends up
getting the call and none of the other phones in the ring group ever
ring, obviously nature of the ring group and the paging amp
pickup the
Post by Elliott Jeyaseelan
call.
Any suggestions on how to go about implementing, I am using Freepbx,
hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
--
----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
Skype: VoipForces
L'information contenue dans le pre'sent document est la
proprie'te' de
Andre Courchesne. Et est divulgue'e en toute confidentialite'. Cette
information ne doit pas e^tre utilise'e, divulgue'e a`
d'autres personnes ou
reproduite sans le consentement e'crit explicite de Andre Courchesne.
The information contained in this document is confidential
and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Andre Courchesne - Consultant
2009-06-19 01:15:40 UTC
Permalink
Hi,

For sure you can not do that all within freePBX, some custom coding
is required.

For the cyberdata hangup when the line is picked-up, Here is the
sequence I would try to do.

1. Someone presses on the intercom button
2. The call goes in a custom code that:
A. Generates a call file to context intercom-speaker
B. Dials a bumch of extension (similar to a ring group), but uses the
M(x) parameter. Something like M(hangup-intercom-speaker.

The intercom-speaker context which would be called by the callfile
would first make an astdb entry of the channel it is using, then play
either a wav file (Playback) or a tone (PlayTone) for a very long time.

The macro-hangup-intercom-speaker context which would be called when
someone answers the phone on the previously calles list of extension
would fetch the astdb entry made in the intercom-speaker context (let's
name it mychannel) and do something like a System(asterisk -rx "soff
hangup ${mychannel}) which should hangup the cyberdata channel.

This should in theory work for one intercom and 1 cyberdata. If you
have multiple intercom, you need to find a way to identify the mychannel...


----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
MSN: courchea-***@public.gmane.org
Skype: VoipForces

L'information contenue dans le présent document est la propriété de
Andre Courchesne. Et est divulguée en toute confidentialité. Cette
information ne doit pas être utilisée, divulguée à d'autres personnes ou
reproduite sans le consentement écrit explicite de Andre Courchesne.

The information contained in this document is confidential and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Post by Elliott Jeyaseelan
Andre,
That sounds like what I am tring to achieve.
Not sure where to even start in Freepbx, but I am going to give it a try
etc.
Thanks for that idea...
Elliott
-----Original Message-----
Sent: Thursday, June 18, 2009 2:24 PM
To: Elliott Jeyaseelan
Subject: Re: [on-asterisk] Paging question
I did something similar for doing a page group on a failover
for a queue where a page would be sent out and the caller be
put in an overflow queue.
The idea is to make a script that would create a callfile to
do the paging and at the "same time" send the caller to the ringgroup.
The callfile would go in a context that would do a page on
your cyberdata playing your tone.
Post by Elliott Jeyaseelan
Need to pick your brain folks, I am sure someone has tackled this
before.
I have a cyberdata voip paging amplifier. Its registered
with Asterisk
Post by Elliott Jeyaseelan
as a SIP extension.
The voip amp automatically answers any incoming call and
plays it to the
Post by Elliott Jeyaseelan
horn.
I have a scenario where there is an Intercom call box,
someone pushes
Post by Elliott Jeyaseelan
the Call button, it rings a ring-group, I want the paging
amp to play a
Post by Elliott Jeyaseelan
tone and other phones in the ring group to ring.
When one of the phones answers, I would like the paging amp
to hang up.
Post by Elliott Jeyaseelan
Problem is, the paging amp being factory set to auto-answer, ends up
getting the call and none of the other phones in the ring group ever
ring, obviously nature of the ring group and the paging amp
pickup the
Post by Elliott Jeyaseelan
call.
Any suggestions on how to go about implementing, I am using Freepbx,
hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
--
----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
Skype: VoipForces
L'information contenue dans le pre'sent document est la
proprie'te' de
Andre Courchesne. Et est divulgue'e en toute confidentialite'. Cette
information ne doit pas e^tre utilise'e, divulgue'e a`
d'autres personnes ou
reproduite sans le consentement e'crit explicite de Andre Courchesne.
The information contained in this document is confidential
and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Elliott Jeyaseelan
2009-06-19 15:10:37 UTC
Permalink
Hi Andre,

That's interesting info.

I will try the suggestion and play around with it to see if it will do the trick.

Elliott
-----Original Message-----
Sent: Thursday, June 18, 2009 9:16 PM
To: Elliott Jeyaseelan
Subject: Re: [on-asterisk] Paging question
Hi,
For sure you can not do that all within freePBX, some
custom coding is required.
For the cyberdata hangup when the line is picked-up, Here
is the sequence I would try to do.
1. Someone presses on the intercom button
A. Generates a call file to context intercom-speaker
B. Dials a bumch of extension (similar to a
ring group), but uses the
M(x) parameter. Something like M(hangup-intercom-speaker.
The intercom-speaker context which would be called by the
callfile would first make an astdb entry of the channel it is
using, then play either a wav file (Playback) or a tone
(PlayTone) for a very long time.
The macro-hangup-intercom-speaker context which would be
called when someone answers the phone on the previously
calles list of extension would fetch the astdb entry made in
the intercom-speaker context (let's name it mychannel) and do
something like a System(asterisk -rx "soff hangup
${mychannel}) which should hangup the cyberdata channel.
This should in theory work for one intercom and 1
cyberdata. If you have multiple intercom, you need to find a
way to identify the mychannel...
----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
Skype: VoipForces
L'information contenue dans le présent document est la propriété de
Andre Courchesne. Et est divulguée en toute confidentialité. Cette
information ne doit pas être utilisée, divulguée à d'autres personnes ou
reproduite sans le consentement écrit explicite de Andre Courchesne.
The information contained in this document is confidential
and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Post by Elliott Jeyaseelan
Andre,
That sounds like what I am tring to achieve.
Not sure where to even start in Freepbx, but I am going to
give it a try
Post by Elliott Jeyaseelan
etc.
Thanks for that idea...
Elliott
-----Original Message-----
From: Andre Courchesne - Consultant
Sent: Thursday, June 18, 2009 2:24 PM
To: Elliott Jeyaseelan
Subject: Re: [on-asterisk] Paging question
I did something similar for doing a page group on a failover
for a queue where a page would be sent out and the caller be
put in an overflow queue.
The idea is to make a script that would create a callfile to
do the paging and at the "same time" send the caller to
the ringgroup.
Post by Elliott Jeyaseelan
The callfile would go in a context that would do a page on
your cyberdata playing your tone.
Post by Elliott Jeyaseelan
Need to pick your brain folks, I am sure someone has tackled this
before.
I have a cyberdata voip paging amplifier. Its registered
with Asterisk
Post by Elliott Jeyaseelan
as a SIP extension.
The voip amp automatically answers any incoming call and
plays it to the
Post by Elliott Jeyaseelan
horn.
I have a scenario where there is an Intercom call box,
someone pushes
Post by Elliott Jeyaseelan
the Call button, it rings a ring-group, I want the paging
amp to play a
Post by Elliott Jeyaseelan
tone and other phones in the ring group to ring.
When one of the phones answers, I would like the paging amp
to hang up.
Post by Elliott Jeyaseelan
Problem is, the paging amp being factory set to
auto-answer, ends up
Post by Elliott Jeyaseelan
Post by Elliott Jeyaseelan
getting the call and none of the other phones in the ring
group ever
Post by Elliott Jeyaseelan
Post by Elliott Jeyaseelan
ring, obviously nature of the ring group and the paging amp
pickup the
Post by Elliott Jeyaseelan
call.
Any suggestions on how to go about implementing, I am
using Freepbx,
Post by Elliott Jeyaseelan
Post by Elliott Jeyaseelan
hoping your suggestion is can be implemented on Freepbx.
Thanks.
---------------------------------------------------------------------
Post by Elliott Jeyaseelan
--
----
Andre Courchesne - Consultant
http://www.net-forces.com
Phone: (514) 667-8448
Skype: VoipForces
L'information contenue dans le pre'sent document est la
proprie'te' de
Andre Courchesne. Et est divulgue'e en toute
confidentialite'. Cette
Post by Elliott Jeyaseelan
information ne doit pas e^tre utilise'e, divulgue'e a`
d'autres personnes ou
reproduite sans le consentement e'crit explicite de Andre
Courchesne.
Post by Elliott Jeyaseelan
The information contained in this document is confidential
and property
of Andre Courchesne. It shall not be used, disclosed to others or
reproduced without the express written consent of Andre Courchesne.
Henry L.Coleman
2009-06-18 00:42:16 UTC
Permalink
Thanks for all the help ..I'm getting close to getting this thing running.
1.) I can mount the stick -sda1 and mask the backup directory on the HD
2.) I can see the directory /asterisk/now in the GUI and backups appear to work
but do not get saved.
3.) I'm going to check the file permissions but any other suggestions?

PS using WinSCP I can easily drag and drop file into the directory

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

=================
Douglas Pickett<
Henry,
The quick answer on where to find mounted filesystems is "df" (which as the
man page states "report file system disk space usage").
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 74842944 2522460 68457256 4% /
/dev/hda1 101086 11084 84783 12% /boot
tmpfs 253700 0 253700 0% /dev/shm
/dev/sda1 2002892 627960 1374932 32% /mnt/usb
The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where the
device is mounted onto the filesystem (in this case /mnt/usb).
As for redirecting the output of the backup (assuming you can't tell the
backup utility to change where it puts the backup) is to change the target
directory of the mount command, or put in a symbolic link. The freepbx
backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to the
backup name, and puts the actual backup file in that directory.
For the mount point idea, instead of mounting to /mnt/usb, you could do
mount /dev/sda1 /var/lib/asterisk/backups
This will hide any files and directories in that backups directory, and
replace them with the directory structure on the USB drive. When you umount
the USB stick they will re-appear.
ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily
This command creates a link in the backups directory called daily, that then
points to a directory on the USB drive. When you backup using the "daily"
config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be writing to
/mnt/usb/daily.
I think the best suggestion is to follow what Mike Ashton suggested with
rsync - you actually do the backups to the local hard drive, but then copy
the files over to the USB device. Given the limited number of write cycles
for USB flash memory, this is probably a good idea.
Regards,
Doug.
----- Original Message -----
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Douglas Pickett
2009-06-18 16:01:53 UTC
Permalink
Henry,
This issue is probably who "owns" the flash drive.

With a flash drive formatted for a DOS style file system (which would be the
most common case), when you mount the drive it doesn't follow the usual
Linux rules for owners and groups and permissions. You've probably mounted
the drive as root, so the default action is to assign root as the owner, and
with the same permissions as root normally has. The backup option within
FreePBX executes as user asterisk and group asterisk, which would not have
permission to write to a directory that only root would have the permissions
for writing. So you need to change the default user and group for the
filesystem.

Use:

mount -o uid=asterisk,gid=asterisk /dev/sda1 /mnt/usb

to mount the drive as owned by asterisk (that what the -o
uid=asterisk,gid=asterisk does).

Regards,
Doug.

----- Original Message -----
From: "Henry L.Coleman" <asterisk-qOF+EEo2OLEsA/***@public.gmane.org>
To: <asterisk-***@public.gmane.org>
Sent: Wednesday, June 17, 2009 8:42 PM
Subject: Re: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
Thanks for all the help ..I'm getting close to getting this thing running.
1.) I can mount the stick -sda1 and mask the backup directory on the HD
2.) I can see the directory /asterisk/now in the GUI and backups appear to work
but do not get saved.
3.) I'm going to check the file permissions but any other suggestions?
PS using WinSCP I can easily drag and drop file into the directory
H
-----------------
Henry L. Coleman
[VoIP-PBX.ca]
=================
Douglas Pickett<
Henry,
The quick answer on where to find mounted filesystems is "df" (which as the
man page states "report file system disk space usage").
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 74842944 2522460 68457256 4% /
/dev/hda1 101086 11084 84783 12% /boot
tmpfs 253700 0 253700 0% /dev/shm
/dev/sda1 2002892 627960 1374932 32% /mnt/usb
The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where the
device is mounted onto the filesystem (in this case /mnt/usb).
As for redirecting the output of the backup (assuming you can't tell the
backup utility to change where it puts the backup) is to change the target
directory of the mount command, or put in a symbolic link. The freepbx
backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to the
backup name, and puts the actual backup file in that directory.
For the mount point idea, instead of mounting to /mnt/usb, you could do
mount /dev/sda1 /var/lib/asterisk/backups
This will hide any files and directories in that backups directory, and
replace them with the directory structure on the USB drive. When you umount
the USB stick they will re-appear.
ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily
This command creates a link in the backups directory called daily, that then
points to a directory on the USB drive. When you backup using the "daily"
config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be writing to
/mnt/usb/daily.
I think the best suggestion is to follow what Mike Ashton suggested with
rsync - you actually do the backups to the local hard drive, but then copy
the files over to the USB device. Given the limited number of write cycles
for USB flash memory, this is probably a good idea.
Regards,
Doug.
----- Original Message -----
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Henry L.Coleman
2009-06-18 23:57:49 UTC
Permalink
Thanks Doug, that was the missing link.
with minor directory changes......

mount -o uid=asterisk,gid=asterisk /dev/sda1 /var/lib/asterisk/backups

....works like a charm :)

Now all I need is to mount this automatically when I insert the stick and un-mount it when
removed.

Thanks to all or their help

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

=================
Douglas Pickett<
Henry,
This issue is probably who "owns" the flash drive.
With a flash drive formatted for a DOS style file system (which would be the
most common case), when you mount the drive it doesn't follow the usual
Linux rules for owners and groups and permissions. You've probably mounted
the drive as root, so the default action is to assign root as the owner, and
with the same permissions as root normally has. The backup option within
FreePBX executes as user asterisk and group asterisk, which would not have
permission to write to a directory that only root would have the permissions
for writing. So you need to change the default user and group for the
filesystem.
mount -o uid=asterisk,gid=asterisk /dev/sda1 /mnt/usb
to mount the drive as owned by asterisk (that what the -o
uid=asterisk,gid=asterisk does).
Regards,
Doug.
----- Original Message -----
Sent: Wednesday, June 17, 2009 8:42 PM
Subject: Re: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
Thanks for all the help ..I'm getting close to getting this thing running.
1.) I can mount the stick -sda1 and mask the backup directory on the HD
2.) I can see the directory /asterisk/now in the GUI and backups appear to work
but do not get saved.
3.) I'm going to check the file permissions but any other suggestions?
PS using WinSCP I can easily drag and drop file into the directory
H
-----------------
Henry L. Coleman
[VoIP-PBX.ca]
=================
Douglas Pickett<
Henry,
The quick answer on where to find mounted filesystems is "df" (which as the
man page states "report file system disk space usage").
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 74842944 2522460 68457256 4% /
/dev/hda1 101086 11084 84783 12% /boot
tmpfs 253700 0 253700 0% /dev/shm
/dev/sda1 2002892 627960 1374932 32% /mnt/usb
The first column reports the device (on this system the USB stick is
/dev/sda1) and the last column ("Mounted on") shows the place where the
device is mounted onto the filesystem (in this case /mnt/usb).
As for redirecting the output of the backup (assuming you can't tell the
backup utility to change where it puts the backup) is to change the target
directory of the mount command, or put in a symbolic link. The freepbx
backup/restore utility seems to create the backups under
/var/lib/asterisk/backups, then creates a directory corresponding to the
backup name, and puts the actual backup file in that directory.
For the mount point idea, instead of mounting to /mnt/usb, you could do
mount /dev/sda1 /var/lib/asterisk/backups
This will hide any files and directories in that backups directory, and
replace them with the directory structure on the USB drive. When you umount
the USB stick they will re-appear.
ln -s /mnt/usb/daily /var/lib/asterisk/backups/daily
This command creates a link in the backups directory called daily, that then
points to a directory on the USB drive. When you backup using the "daily"
config, the utility will think it is writing to the
/var/lib/asterisk/backups/daily directory, but will actually be writing to
/mnt/usb/daily.
I think the best suggestion is to follow what Mike Ashton suggested with
rsync - you actually do the backups to the local hard drive, but then copy
the files over to the USB device. Given the limited number of write cycles
for USB flash memory, this is probably a good idea.
Regards,
Doug.
----- Original Message -----
Sent: Tuesday, June 16, 2009 1:48 PM
Subject: [on-asterisk] Backup and restore to a USB stick
Post by Henry L.Coleman
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]
-------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Continue reading on narkive:
Loading...