Re: [on-asterisk] Backup and Restore

2010-12-23 Thread Henry Coleman
On Thu, Dec 23, 2010 at 2:45 PM, Henry Coleman henry.cole...@voip-pbx.cawrote:

 Thanks for staying with this.
 Here's what is happening

 When creating a backup in Freepbx  the backup *name* will create a
 directory, otherwise the option is to add it to an existing directory and it
 goes ahead and adds the backup file (tar.gz) file into an existing
 directory. The new or existing directories are owned all owned by *
 asterisk*
 When the stick is inserted initially there are no sub-directories off the
 mounted * var/lib/asterisk/backups*. If an attempt is made to backup using
 a new *name* the new directory doesn't display and the file gets lost.
 Using Putty and Winscp I can see the newly created directory but it is
 owned by* root, *attempting to change this using *chown* creates an error
 saying I don't have permission to change the owner. (very odd).
 So it seems as though it is still a owner/permission problem.

 Thanks Henry










 On Wed, Dec 22, 2010 at 12:18 PM, John Lange j...@johnlange.ca wrote:

 On Wed, Dec 22, 2010 at 9:22 AM, Henry Coleman
 henry.cole...@voip-pbx.ca wrote:
  Inserting the stick and refreshing the GUI page shows the new directory
  structure on the USB stick.
  However after a backup they get saved to the HD directory instead

 You lost me there. If the USB is mounted on top of
 /var/lib/asterisk/backups, then it would be impossible for you to
 write to that directory and have it written to the hard disk.

  Unplugging the USB stick does not restore the original HD directory,
 only a reboot does this.

 We probably need to fix something in this section:

 # Clean up after removal
 ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
 /var/lib/asterisk/backups

 After removing the usb key, try running the unmount manually and see
 what it says:

 # /bin/umount -l /var/lib/asterisk/backups

 There should also be a log of what happened in /var/log/messages
 (That's assuming CentOS uses /var/log/messages for udev logging).

 The most likely explanation is that the file system is busy
 preventing it from being unmounted. If that is the case you can do (as
 root):

 # lsof | grep /var/lib/asterisk/backups

 to find out what it is.

 --
 John Lange
 www.johnlange.ca




 --
 *Henry L. Coleman *
 ***Per: VoIP-PBX.ca
 *
 *
 *





-- 
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*


Re: [on-asterisk] Backup and Restore

2010-12-23 Thread Douglas Pickett

Henry,

I think the issue is that when you mount a non-unix filesystem, like a 
fat/msdos, they don't have users and groups.


The default, from the mount man page, is to use the user and group of 
the user issuing the mount command, which would probably be root.  Have 
a look at the uid and gid option until the filesystem type specific 
section - you probably want to make it asterisk and asterisk.


The other option could be to make it a ext or other unix type filesystem 
- but then it would be tough to use the USB stick on a Windows system.


Regards,
Doug.


On 23/12/2010 2:47 PM, Henry Coleman wrote:

On Thu, Dec 23, 2010 at 2:45 PM, Henry Colemanhenry.cole...@voip-pbx.cawrote:


Thanks for staying with this.
Here's what is happening

When creating a backup in Freepbx  the backup *name* will create a
directory, otherwise the option is to add it to an existing directory and it
goes ahead and adds the backup file (tar.gz) file into an existing
directory. The new or existing directories are owned all owned by *
asterisk*
When the stick is inserted initially there are no sub-directories off the
mounted * var/lib/asterisk/backups*. If an attempt is made to backup using
a new *name* the new directory doesn't display and the file gets lost.
Using Putty and Winscp I can see the newly created directory but it is
owned by* root, *attempting to change this using *chown* creates an error
saying I don't have permission to change the owner. (very odd).
So it seems as though it is still a owner/permission problem.

Thanks Henry










On Wed, Dec 22, 2010 at 12:18 PM, John Langej...@johnlange.ca  wrote:


On Wed, Dec 22, 2010 at 9:22 AM, Henry Coleman
henry.cole...@voip-pbx.ca  wrote:

Inserting the stick and refreshing the GUI page shows the new directory
structure on the USB stick.
However after a backup they get saved to the HD directory instead


You lost me there. If the USB is mounted on top of
/var/lib/asterisk/backups, then it would be impossible for you to
write to that directory and have it written to the hard disk.


Unplugging the USB stick does not restore the original HD directory,

only a reboot does this.

We probably need to fix something in this section:

# Clean up after removal
ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
/var/lib/asterisk/backups

After removing the usb key, try running the unmount manually and see
what it says:

# /bin/umount -l /var/lib/asterisk/backups

There should also be a log of what happened in /var/log/messages
(That's assuming CentOS uses /var/log/messages for udev logging).

The most likely explanation is that the file system is busy
preventing it from being unmounted. If that is the case you can do (as
root):

# lsof | grep /var/lib/asterisk/backups

to find out what it is.

--
John Lange
www.johnlange.ca





--
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*









-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and Restore

2010-12-22 Thread Henry Coleman
On Wed, Dec 22, 2010 at 10:21 AM, Henry Coleman
henry.cole...@voip-pbx.cawrote:

 Hi John, thanks for getting back to me.
 I made the changes as you suggested. and things are looking much better.
 It's a bit like the old shell game first you see it then you don't
 so here is the current status:
 Booting up ... There are no reported errors re: chown
 without the USB stick thing work as normal ie backup and restore in backup
 directory etc.
 Inserting the stick and refreshing the GUI page shows the new directory
 structure on the USB stick.
 However after a backup they get saved to the HD directory instead
 Unplugging the USB stick does not restore the original HD directory, only a
 reboot does this.
 Thank you for your time on this, I think backup strategies would be a great
 topic for TAUG meeting.
 Can you do one?
 Henry








 On Mon, Dec 20, 2010 at 2:42 PM, John Lange j...@johnlange.ca wrote:

 Henry, sorry for the slow reply. Hopefully you solved this already but
 if not, the area of the udev file that you need to modify is:

 $env{mount_options},utf8,gid=100,umask=002

 Change gid= to the value of the group you want the file system to be
 mounted and owned as and also add uid= and set it to the user id
 that matches your asterisk user.

 You can discover these values with the command:

 # id asterisk

 I haven't tested this myself but that should solve your problem.

 John

 On Wed, Dec 15, 2010 at 9:23 AM, Henry Coleman
 henry.cole...@voip-pbx.ca wrote:
 
 
  On Wed, Dec 15, 2010 at 10:03 AM, Henry Coleman 
 henry.cole...@voip-pbx.ca
  wrote:
 
  Hi John, I didn't mean to be critical about any typo's, I was replying
 to
  a post that thought relatime was
  mis-spelled, anyway this was not the case (as you know).
  You are correct, simply commenting out that line works, and the freepbx
  GUI is able to see the mounted USB directory.
  If I make a backup it doesn't create a file on the device and if I
 remove
  the stick it does not see the original directory
  If I reboot the machine (without the stick) then it restores the
 original
  file structure back to normal.
  I think this is a very close to a great solution for many Asterisk
  followers but the coding is way over my pay grade.
 
  Thanks Henry
 
  After checking some stuff one problem may have to do with permissions:
  File backups in /var/lib/asterisk/backups/xxx... have the owner as
  asterisk while the stick has the owner of the directory
  as root. I will attempt to change this but I could use some help.
  Thanks again Henry
 
 
 
 
 
 
 
  On Tue, Dec 14, 2010 at 1:59 PM, John Lange j...@johnlange.ca wrote:
 
  If I understand what you are saying; even though you commented out the
  entire line with the relatime option, you are still getting the same
  mount
  error when you insert the USB stick?
 
  When you change the udev rules, udev should automatically re-read the
  options, but just in case it doesn't, you can issue:
 
  # udevadm control --reload-rules
 
  (I'm not 100% sure that command exists in centos though...)
 
  If that has all been done properly then it seems impossible that you
 are
  still getting the same error...
 
  When you remove the drive, is it unmounted (check at the command line
  using
  the 'mount' command).
 
  And what typo are you referring to? I don't amke typos! ;)
 
  --
  John Lange
  www.johnlange.ca
 
 
 
  --
  Henry L. Coleman
  Per: VoIP-PBX.ca
 
 
 
 
 
  --
  Henry L. Coleman
  Per: VoIP-PBX.ca
 
 
 



 --
 John Lange
 www.johnlange.ca




 --
 *Henry L. Coleman *
 ***Per: VoIP-PBX.ca
 *
 *
 *





-- 
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*


Re: [on-asterisk] Backup and Restore

2010-12-22 Thread John Lange
On Wed, Dec 22, 2010 at 9:22 AM, Henry Coleman
henry.cole...@voip-pbx.ca wrote:
 Inserting the stick and refreshing the GUI page shows the new directory
 structure on the USB stick.
 However after a backup they get saved to the HD directory instead

You lost me there. If the USB is mounted on top of
/var/lib/asterisk/backups, then it would be impossible for you to
write to that directory and have it written to the hard disk.

 Unplugging the USB stick does not restore the original HD directory, only a 
 reboot does this.

We probably need to fix something in this section:

# Clean up after removal
ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
/var/lib/asterisk/backups

After removing the usb key, try running the unmount manually and see
what it says:

# /bin/umount -l /var/lib/asterisk/backups

There should also be a log of what happened in /var/log/messages
(That's assuming CentOS uses /var/log/messages for udev logging).

The most likely explanation is that the file system is busy
preventing it from being unmounted. If that is the case you can do (as
root):

# lsof | grep /var/lib/asterisk/backups

to find out what it is.

-- 
John Lange
www.johnlange.ca

-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and Restore

2010-12-14 Thread Henry Coleman
Thanks John, this is a really elegant solution.
Plugging in a USB stick however, CLI reports:

*FAT: Unrecognised mount option relatime or missing value*
*
*
I checked the link you included but there's nothing obvious that would give
this error.
(My stick is formatted NTFS)

Thanks Henry

On Mon, Dec 13, 2010 at 5:43 PM, John Lange j...@johnlange.ca wrote:

 In short; create this file (*  /etc/udev/rules.d/11-backup-auto-mount.rules
 ) *by copying and pasting the text between the start and end tags:

  --- start ---
 * *
 KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

 # Import FS infos
 IMPORT{program}=/sbin/blkid -o udev -p %N

 # Global mount options
 ACTION==add, ENV{mount_options}=relatime
 # Filesystem-specific mount options
 ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
 ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

 # Mount the device
 ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
 /var/lib/asterisk/backups

 # Clean up after removal
 ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
 /var/lib/asterisk/backups

 # Exit
 LABEL=backup_auto_mount_end

  --- end ---

 You can then insert and remove your key without touching the system. (I'm
 making a lot of assumptions about FreePBX that should be correct, for
 example that it uses udev).

 Lots more suggestions on udev rules here:

 https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


 --
 John Lange
 www.johnlange.ca

 On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman 
 henry.cole...@voip-pbx.cawrote:

 Thanks for all the suggestions. So far I think that Doug' solution looks
 the most promising, however
 it needs automating so that inserting the USB stick will automatically
 mount the stick and disconnection will umount the stick.
 (A sort of plug and play if you will) Restore might work also based on
 this principle.

 So I'm gonna pick your Linux brains (again) and ask if this can be done?
 Henry   [?]




-- 
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*


RE: [on-asterisk] Backup and Restore

2010-12-14 Thread Bill Sandiford
Reformat the stick as FAT and your problem should go away.

Can be done from Windows...right click on the drive the in the My 
Computer...choose Format...and then select FAT as the file system type from the 
dropdown.

Bill

From: Henry Coleman [mailto:henry.cole...@voip-pbx.ca]
Sent: Tuesday, December 14, 2010 10:25 AM
To: TAUG Technical
Subject: Re: [on-asterisk] Backup and Restore

Thanks John, this is a really elegant solution.
Plugging in a USB stick however, CLI reports:

FAT: Unrecognised mount option relatime or missing value

I checked the link you included but there's nothing obvious that would give 
this error.
(My stick is formatted NTFS)

Thanks Henry

On Mon, Dec 13, 2010 at 5:43 PM, John Lange 
j...@johnlange.camailto:j...@johnlange.ca wrote:
In short; create this file (  /etc/udev/rules.d/11-backup-auto-mount.rules ) by 
copying and pasting the text between the start and end tags:

 --- start ---

KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

# Import FS infos
IMPORT{program}=/sbin/blkid -o udev -p %N

# Global mount options
ACTION==add, ENV{mount_options}=relatime
# Filesystem-specific mount options
ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs, 
ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

# Mount the device
ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k 
/var/lib/asterisk/backups

# Clean up after removal
ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l 
/var/lib/asterisk/backups

# Exit
LABEL=backup_auto_mount_end

 --- end ---

You can then insert and remove your key without touching the system. (I'm 
making a lot of assumptions about FreePBX that should be correct, for example 
that it uses udev).

Lots more suggestions on udev rules here:

https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


--
John Lange
www.johnlange.cahttp://www.johnlange.ca
On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman 
henry.cole...@voip-pbx.camailto:henry.cole...@voip-pbx.ca wrote:
Thanks for all the suggestions. So far I think that Doug' solution looks the 
most promising, however
it needs automating so that inserting the USB stick will automatically mount 
the stick and disconnection will umount the stick.
(A sort of plug and play if you will) Restore might work also based on this 
principle.

So I'm gonna pick your Linux brains (again) and ask if this can be done?
Henry   [cid:voip-pbx_ca.330@goomoji.gmail]




--
Henry L. Coleman
Per: VoIP-PBX.ca





Re: [on-asterisk] Backup and Restore

2010-12-14 Thread Mike Ashton

For easier compatibility format your USB key as FAT32

On 12/14/2010 10:25 AM, Henry Coleman wrote:

Thanks John, this is a really elegant solution.
Plugging in a USB stick however, CLI reports:

*FAT: Unrecognised mount option relatime or missing value*
*
*
I checked the link you included but there's nothing obvious that would 
give this error.

(My stick is formatted NTFS)

Thanks Henry

On Mon, Dec 13, 2010 at 5:43 PM, John Lange j...@johnlange.ca 
mailto:j...@johnlange.ca wrote:


In short; create this file
(*/etc/udev/rules.d/11-backup-auto-mount.rules ) *by copying and
pasting the text between the start and end tags:

 --- start ---
**
KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

# Import FS infos
IMPORT{program}=/sbin/blkid -o udev -p %N

# Global mount options
ACTION==add, ENV{mount_options}=relatime
# Filesystem-specific mount options
ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

# Mount the device
ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
/var/lib/asterisk/backups

# Clean up after removal
ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
/var/lib/asterisk/backups

# Exit
LABEL=backup_auto_mount_end

 --- end ---

You can then insert and remove your key without touching the
system. (I'm making a lot of assumptions about FreePBX that should
be correct, for example that it uses udev).

Lots more suggestions on udev rules here:

https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


-- 
John Lange

www.johnlange.ca http://www.johnlange.ca

On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman
henry.cole...@voip-pbx.ca mailto:henry.cole...@voip-pbx.ca wrote:

Thanks for all the suggestions. So far I think that Doug'
solution looks the most promising, however
it needs automating so that inserting the USB stick will
automatically mount the stick and disconnection will
umount the stick.
(A sort of plug and play if you will) Restore might work also
based on this principle.

So I'm gonna pick your Linux brains (again) and ask if this
can be done?
Henry




--
/Henry L. Coleman /
/Per: VoIP-PBX.ca
/
/
/



--

Mike Ashton

Quality Track International

Work:   +1 647 724 3500 x251
Cell:   +1 416 527 4995

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: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

Re: [on-asterisk] Backup and Restore

2010-12-14 Thread John Lange
I don't think reformatting your usb key will solve that mount error. I don't
have access to a freepbx system verify this but my guess is the version of
mount is too old to support relatime.

Regardless, you can safely delete this whole section:

# Global mount options
ACTION==add, ENV{mount_options}=relatime

relatime  noatime are tweaks to the mounting that prevent linux from
updating the atime of the file. It dramatically cuts down on file system
access which not only improves performance but also lengthens the life of
storage that has a maximum re-write lifetime.

This is --way-- off topic but if you are interested in performance tweaking
of linux file systems you can experiment with mounting your devices with the
noatime option. However, it can cause problems with certain programs that
require accurate atime information so use with caution.

By the way, if you needed to reformat the key you can format fat32 (vfat) on
Linux:

# mkfs -t vfat /dev/sdb1

Or if you don't need to plug this usb into a Windows machine you can just
format the key with ext3.

-- 
John Lange
www.johnlange.ca

On Tue, Dec 14, 2010 at 10:14 AM, Mike Ashton
mike.ash...@qualitytrack.comwrote:

  For easier compatibility format your USB key as FAT32


 On 12/14/2010 10:25 AM, Henry Coleman wrote:

 Thanks John, this is a really elegant solution.
 Plugging in a USB stick however, CLI reports:

  *FAT: Unrecognised mount option relatime or missing value*
 *
 *
 I checked the link you included but there's nothing obvious that would give
 this error.
 (My stick is formatted NTFS)

  Thanks Henry

 On Mon, Dec 13, 2010 at 5:43 PM, John Lange j...@johnlange.ca wrote:

 In short; create this file (*  /etc/udev/rules.d/11-backup-auto-mount.rules
 ) *by copying and pasting the text between the start and end tags:

  --- start ---
 * *
 KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

 # Import FS infos
 IMPORT{program}=/sbin/blkid -o udev -p %N

 # Global mount options
 ACTION==add, ENV{mount_options}=relatime
 # Filesystem-specific mount options
 ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
 ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

 # Mount the device
 ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
 /var/lib/asterisk/backups

 # Clean up after removal
 ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
 /var/lib/asterisk/backups

 # Exit
 LABEL=backup_auto_mount_end

  --- end ---

 You can then insert and remove your key without touching the system. (I'm
 making a lot of assumptions about FreePBX that should be correct, for
 example that it uses udev).

 Lots more suggestions on udev rules here:

 https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


 --
 John Lange
 www.johnlange.ca

  On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman 
 henry.cole...@voip-pbx.ca wrote:

  Thanks for all the suggestions. So far I think that Doug' solution looks
 the most promising, however
 it needs automating so that inserting the USB stick will automatically
 mount the stick and disconnection will umount the stick.
 (A sort of plug and play if you will) Restore might work also based on
 this principle.

  So I'm gonna pick your Linux brains (again) and ask if this can be
 done?
  Henry   [?]




 --
 *Henry L. Coleman *
 *Per: VoIP-PBX.ca
 *
 *
 *



 --

 Mike Ashton

 Quality Track International

 Work: +1 647 724 3500 x251
 Cell: +1 416 527 4995

 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: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and Restore

2010-12-14 Thread Henry Coleman
Just to make sure that we are on the same page, the Distro is PBX in a flash
(PIAF)
Centos 5.2, Asterisk 1.6, Freepbx 2.7

On Tue, Dec 14, 2010 at 1:01 PM, Henry Coleman henry.cole...@voip-pbx.cawrote:

 Hi all I have commented out the line as suggested.(tried fixing the typo,
 didn't make any difference)
 Initially, hot plugging the USB will display the USB file system however on
 unplugging the stick
 the old file system will not return unless I reboot (with the stick
 removed).
 I tried to save a file on the USB drive which should create a directory and
 file:
 ie. var/lib/asterisk/backups/*usb*/date_and_time filename.tgz but this
 didn't create a directory or a file.

 The good news is that I does auto mount ...

 Henry


 On Tue, Dec 14, 2010 at 12:33 PM, John Lange j...@johnlange.ca wrote:

 I don't think reformatting your usb key will solve that mount error. I
 don't have access to a freepbx system verify this but my guess is the
 version of mount is too old to support relatime.

 Regardless, you can safely delete this whole section:


 # Global mount options
 ACTION==add, ENV{mount_options}=relatime

 relatime  noatime are tweaks to the mounting that prevent linux from
 updating the atime of the file. It dramatically cuts down on file system
 access which not only improves performance but also lengthens the life of
 storage that has a maximum re-write lifetime.

 This is --way-- off topic but if you are interested in performance
 tweaking of linux file systems you can experiment with mounting your devices
 with the noatime option. However, it can cause problems with certain
 programs that require accurate atime information so use with caution.

 By the way, if you needed to reformat the key you can format fat32 (vfat)
 on Linux:

 # mkfs -t vfat /dev/sdb1

 Or if you don't need to plug this usb into a Windows machine you can just
 format the key with ext3.


 --
 John Lange
 www.johnlange.ca

 On Tue, Dec 14, 2010 at 10:14 AM, Mike Ashton 
 mike.ash...@qualitytrack.com wrote:

  For easier compatibility format your USB key as FAT32


 On 12/14/2010 10:25 AM, Henry Coleman wrote:

 Thanks John, this is a really elegant solution.
 Plugging in a USB stick however, CLI reports:

  *FAT: Unrecognised mount option relatime or missing value*
 *
 *
 I checked the link you included but there's nothing obvious that would
 give this error.
 (My stick is formatted NTFS)

  Thanks Henry

 On Mon, Dec 13, 2010 at 5:43 PM, John Lange j...@johnlange.ca wrote:

 In short; create this file (*  /etc/udev/rules.d/11-backup-auto-mount.rules
 ) *by copying and pasting the text between the start and end tags:

  --- start ---
 * *
 KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

 # Import FS infos
 IMPORT{program}=/sbin/blkid -o udev -p %N

 # Global mount options
 ACTION==add, ENV{mount_options}=relatime
 # Filesystem-specific mount options
 ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
 ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

 # Mount the device
 ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
 /var/lib/asterisk/backups

 # Clean up after removal
 ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
 /var/lib/asterisk/backups

 # Exit
 LABEL=backup_auto_mount_end

  --- end ---

 You can then insert and remove your key without touching the system.
 (I'm making a lot of assumptions about FreePBX that should be correct, for
 example that it uses udev).

 Lots more suggestions on udev rules here:

 https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


 --
 John Lange
 www.johnlange.ca

  On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman 
 henry.cole...@voip-pbx.ca wrote:

  Thanks for all the suggestions. So far I think that Doug' solution
 looks the most promising, however
 it needs automating so that inserting the USB stick will automatically
 mount the stick and disconnection will umount the stick.
 (A sort of plug and play if you will) Restore might work also based on
 this principle.

  So I'm gonna pick your Linux brains (again) and ask if this can be
 done?
  Henry   [?]




 --
 *Henry L. Coleman *
 *Per: VoIP-PBX.ca
 *
 *
 *



 --

 Mike Ashton

 Quality Track International

 Work:   +1 647 724 3500 x251
 Cell:   +1 416 527 4995

 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: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org






 --
 *Henry L. Coleman *
 ***Per: VoIP-PBX.ca
 *
 

Re: [on-asterisk] Backup and Restore

2010-12-14 Thread John Lange
If I understand what you are saying; even though you commented out the
entire line with the relatime option, you are still getting the same mount
error when you insert the USB stick?

When you change the udev rules, udev should automatically re-read the
options, but just in case it doesn't, you can issue:

# udevadm control --reload-rules

(I'm not 100% sure that command exists in centos though...)

If that has all been done properly then it seems impossible that you are
still getting the same error...

When you remove the drive, is it unmounted (check at the command line using
the 'mount' command).

And what typo are you referring to? I don't amke typos! ;)

-- 
John Lange
www.johnlange.ca


Re: [on-asterisk] Backup and Restore

2010-12-14 Thread Henry Coleman
On Tue, Dec 14, 2010 at 3:07 PM, Henry Coleman henry.cole...@voip-pbx.cawrote:

 Hi Dean, yes there are a lot of ways to back up the system in FreePBX  but
 none allow for USB drives or CD's (removable media)
 For clients who want complete protection against fire, theft and being
 Bricked the ability to take the stick home every evening.
 is a sound tactic. It takes less than an hour to build the distro from
 scratch and a minute or so to restore the conf, cdr and Vmail on a new or
 backup PC.

 Henry



 On Tue, Dec 14, 2010 at 2:36 PM, Dean Yorke dean.yo...@xyc.ca wrote:

 you need to search the board on piaf.  they have great backup and restore
 routines.  and it backs up everything if that is what you want!


 On 2010-12-14, at 1:09 PM, Henry Coleman wrote:

 Just to make sure that we are on the same page, the Distro is PBX in a
 flash (PIAF)
 Centos 5.2, Asterisk 1.6, Freepbx 2.7

 On Tue, Dec 14, 2010 at 1:01 PM, Henry Coleman henry.cole...@voip-pbx.ca
  wrote:

 Hi all I have commented out the line as suggested.(tried fixing the typo,
 didn't make any difference)
 Initially, hot plugging the USB will display the USB file system however
 on unplugging the stick
 the old file system will not return unless I reboot (with the stick
 removed).
 I tried to save a file on the USB drive which should create a directory
 and file:
 ie. var/lib/asterisk/backups/*usb*/date_and_time filename.tgz but this
 didn't create a directory or a file.

 The good news is that I does auto mount ...

 Henry


 On Tue, Dec 14, 2010 at 12:33 PM, John Lange j...@johnlange.ca wrote:

 I don't think reformatting your usb key will solve that mount error. I
 don't have access to a freepbx system verify this but my guess is the
 version of mount is too old to support relatime.

 Regardless, you can safely delete this whole section:


 # Global mount options
 ACTION==add, ENV{mount_options}=relatime

 relatime  noatime are tweaks to the mounting that prevent linux
 from updating the atime of the file. It dramatically cuts down on file
 system access which not only improves performance but also lengthens the
 life of storage that has a maximum re-write lifetime.

 This is --way-- off topic but if you are interested in performance
 tweaking of linux file systems you can experiment with mounting your 
 devices
 with the noatime option. However, it can cause problems with certain
 programs that require accurate atime information so use with caution.

 By the way, if you needed to reformat the key you can format fat32
 (vfat) on Linux:

 # mkfs -t vfat /dev/sdb1

 Or if you don't need to plug this usb into a Windows machine you can
 just format the key with ext3.


 --
 John Lange
 www.johnlange.ca

 On Tue, Dec 14, 2010 at 10:14 AM, Mike Ashton 
 mike.ash...@qualitytrack.com wrote:

  For easier compatibility format your USB key as FAT32


 On 12/14/2010 10:25 AM, Henry Coleman wrote:

 Thanks John, this is a really elegant solution.
 Plugging in a USB stick however, CLI reports:

  *FAT: Unrecognised mount option relatime or missing value*
 *
 *
 I checked the link you included but there's nothing obvious that would
 give this error.
 (My stick is formatted NTFS)

  Thanks Henry

 On Mon, Dec 13, 2010 at 5:43 PM, John Lange j...@johnlange.ca wrote:

 In short; create this file (*  
 /etc/udev/rules.d/11-backup-auto-mount.rules
 ) *by copying and pasting the text between the start and end tags:

  --- start ---
 * *
 KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

 # Import FS infos
 IMPORT{program}=/sbin/blkid -o udev -p %N

 # Global mount options
 ACTION==add, ENV{mount_options}=relatime
 # Filesystem-specific mount options
 ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
 ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

 # Mount the device
 ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
 /var/lib/asterisk/backups

 # Clean up after removal
 ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
 /var/lib/asterisk/backups

 # Exit
 LABEL=backup_auto_mount_end

  --- end ---

 You can then insert and remove your key without touching the system.
 (I'm making a lot of assumptions about FreePBX that should be correct, 
 for
 example that it uses udev).

 Lots more suggestions on udev rules here:

 https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices


 --
 John Lange
 www.johnlange.ca

  On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman 
 henry.cole...@voip-pbx.ca wrote:

  Thanks for all the suggestions. So far I think that Doug' solution
 looks the most promising, however
 it needs automating so that inserting the USB stick will
 automatically mount the stick and disconnection will umount the 
 stick.
 (A sort of plug and play if you will) Restore might work also based
 on this principle.

  So I'm gonna pick your Linux brains (again) and ask if this can be
 done?
  Henry




 --
 *Henry L. Coleman *
 *Per: VoIP-PBX.ca
 *
 *
 *



 --

 Mike Ashton

 Quality Track International

 Work: +1 647 724 

Re: [on-asterisk] Backup and Restore

2010-12-13 Thread Alex Robar
Hi Henry,

At home I just setup the backup schedule under FreePBX for a nightly backup.
I then setup a small shell script to copy the directory to a USB drive. I
set this script to fire off 15 minutes after the backup starts using cron.
The script is just something like this:

---
#!/bin/bash

cp -R -u -f /var/lib/asterisk/backups/ /path/to/usb
---

This copies using the update switch so that only newer files get copied to
the USB drive.

In the event of a restore you will need to manually copy the USB contents
back to /var/lib/asterisk/backups to get FreePBX to see your backups. I
never thought of mounting the backup directory to the USB drive, so your
solution may actually be better - Just thought I'd throw this out there as
an alternative.

AR

-- 
Alex Robar
alex.ro...@gmail.com



On Mon, Dec 13, 2010 at 10:43 AM, Henry Coleman
henry.cole...@voip-pbx.cawrote:

 I remember asking this question about two years ago but unfortunately
 didn't
 document the answers.
 I need to Backup and Restore using the FreePBX Module but to a USB stick
 rather than an asterisk directory.
 Currently this directory is:  '/var/lib/asterisk/backups/$Backup_Name'
 however changing this will break the Restore
 I understand that the best way is to mount this directory onto the USB.
 Unfortunately this is beyond my abilities.
 If the USB stick is removed the backup and restore should be available in
 the normal way.

 Hoping that someone out there can sort me out
 Thanks H




 --
 *Henry L. Coleman *
 ***Per: VoIP-PBX.ca
 *
 *
 *



Re: [on-asterisk] Backup and Restore

2010-12-13 Thread Mike Ashton

Henry,

I use this to mount the usb key write the backup run in the last day to 
it and unmount the usb key. I mount / umount so nothing else 
accidentally writes to the usb key.


#!/bin/bash
testval=`/sbin/fdisk -l | grep FAT | cut -d   -f 1`
if [ -n $testval ]
 then
 echo mounting $testval
 mount -t msdos $testval /mnt/usbstorage
 find /var/lib/asterisk/backups/daily -type f -mtime -1 -exec cp {} 
/mnt/usbstorage \;

 sync
 umount /mnt/usbstorage
 else
 echo No Drive
 fi

Assumptions:
 - USB Key is formated with FAT
 - you have created a directory in the /mnt to match name used in script
 - your only running one back up a day

Then just create a cron job to run this after your scheduled back up has 
run, say 15 minutes after wards.


Hope this helps.

Mike


On 12/13/2010 10:43 AM, Henry Coleman wrote:

I remember asking this question about two years ago but unfortunately didn't
document the answers.
I need to Backup and Restore using the FreePBX Module but to a USB stick
rather than an asterisk directory.
Currently this directory is:  '/var/lib/asterisk/backups/$Backup_Name'
however changing this will break the Restore
I understand that the best way is to mount this directory onto the USB.
Unfortunately this is beyond my abilities.
If the USB stick is removed the backup and restore should be available in
the normal way.

Hoping that someone out there can sort me out
Thanks H






--

Mike Ashton

Quality Track International

Work:   +1 647 724 3500 x251
Cell:   +1 416 527 4995

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: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

Re: [on-asterisk] Backup and Restore

2010-12-13 Thread Marc Carrafiello
It's interesting that everyone's suggesting using -t msdos and not -t
vfat.  You aren't worried about losing long filename support?  I though the
msdos type only support 8.3 filenames..  Or is msdos finally a synonym for
vfat?

-Marc


On Mon, Dec 13, 2010 at 12:34 PM, Mike Ashton
mike.ash...@qualitytrack.comwrote:

  Henry,

 I use this to mount the usb key write the backup run in the last day to it
 and unmount the usb key. I mount / umount so nothing else accidentally
 writes to the usb key.

 #!/bin/bash
 testval=`/sbin/fdisk -l | grep FAT | cut -d   -f 1`
 if [ -n $testval ]
  then
  echo mounting $testval
  mount -t msdos $testval /mnt/usbstorage
  find /var/lib/asterisk/backups/daily -type f -mtime -1 -exec cp {}
 /mnt/usbstorage \;
  sync
  umount /mnt/usbstorage
  else
  echo No Drive
  fi

 Assumptions:
  - USB Key is formated with FAT
  - you have created a directory in the /mnt to match name used in script
  - your only running one back up a day

 Then just create a cron job to run this after your scheduled back up has
 run, say 15 minutes after wards.

 Hope this helps.

 Mike



 On 12/13/2010 10:43 AM, Henry Coleman wrote:

 I remember asking this question about two years ago but unfortunately didn't
 document the answers.
 I need to Backup and Restore using the FreePBX Module but to a USB stick
 rather than an asterisk directory.
 Currently this directory is:  '/var/lib/asterisk/backups/$Backup_Name'
 however changing this will break the Restore
 I understand that the best way is to mount this directory onto the USB.
 Unfortunately this is beyond my abilities.
 If the USB stick is removed the backup and restore should be available in
 the normal way.

 Hoping that someone out there can sort me out
 Thanks H






 --

 Mike Ashton

 Quality Track International

 Work: +1 647 724 3500 x251
 Cell: +1 416 527 4995

 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: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and Restore

2010-12-13 Thread John Lange
Douglas had the correct solution but just leave out the -t msdos.
Mount will auto-detect the file system so no need to specify it.

If you want to get really fancy, you can setup udev to auto-mount your
usb key at the same place every time it's plugged in. That way you can
just walk up and plug it in without touching anything else.

Pretty advanced but I can write more on this if anyone is interested.

-- 
John Lange
www.johnlange.ca

-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and Restore

2010-12-13 Thread Henry Coleman
Thanks for all the suggestions. So far I think that Doug' solution looks the
most promising, however
it needs automating so that inserting the USB stick will automatically
mount the stick and disconnection will umount the stick.
(A sort of plug and play if you will) Restore might work also based on this
principle.

So I'm gonna pick your Linux brains (again) and ask if this can be done?
Henry   [?]

On Mon, Dec 13, 2010 at 5:03 PM, Henry Coleman henry.cole...@voip-pbx.cawrote:

 Thanks for all the suggestions. So far I think that Doug' solution looks
 the most promising, however
 it needs automating so that inserting the USB stick will automatically
 mount the stick and disconnection will umount the stick.
 (A sort of plug and play if you will) Restore might work also based on this
 principle.

 So I'm gonna pick your Linux brains (again) and ask if this can be done?
 Henry


 On Mon, Dec 13, 2010 at 3:56 PM, Marc Carrafiello 
 mcarrafie...@datex.cawrote:

 It's interesting that everyone's suggesting using -t msdos and not -t
 vfat.  You aren't worried about losing long filename support?  I though
 the
 msdos type only support 8.3 filenames..  Or is msdos finally a synonym
 for
 vfat?

 -Marc


 On Mon, Dec 13, 2010 at 12:34 PM, Mike Ashton
 mike.ash...@qualitytrack.comwrote:

   Henry,
 
  I use this to mount the usb key write the backup run in the last day to
 it
  and unmount the usb key. I mount / umount so nothing else accidentally
  writes to the usb key.
 
  #!/bin/bash
  testval=`/sbin/fdisk -l | grep FAT | cut -d   -f 1`
  if [ -n $testval ]
   then
   echo mounting $testval
   mount -t msdos $testval /mnt/usbstorage
   find /var/lib/asterisk/backups/daily -type f -mtime -1 -exec cp {}
  /mnt/usbstorage \;
   sync
   umount /mnt/usbstorage
   else
   echo No Drive
   fi
 
  Assumptions:
   - USB Key is formated with FAT
   - you have created a directory in the /mnt to match name used in script
   - your only running one back up a day
 
  Then just create a cron job to run this after your scheduled back up has
  run, say 15 minutes after wards.
 
  Hope this helps.
 
  Mike
 
 
 
  On 12/13/2010 10:43 AM, Henry Coleman wrote:
 
  I remember asking this question about two years ago but unfortunately
 didn't
  document the answers.
  I need to Backup and Restore using the FreePBX Module but to a USB stick
  rather than an asterisk directory.
  Currently this directory is:  '/var/lib/asterisk/backups/$Backup_Name'
  however changing this will break the Restore
  I understand that the best way is to mount this directory onto the USB.
  Unfortunately this is beyond my abilities.
  If the USB stick is removed the backup and restore should be available
 in
  the normal way.
 
  Hoping that someone out there can sort me out
  Thanks H
 
 
 
 
 
 
  --
 
  Mike Ashton
 
  Quality Track International
 
  Work: +1 647 724 3500 x251
  Cell: +1 416 527 4995
 
  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: asterisk-unsubscr...@uc.org
  For additional commands, e-mail: asterisk-h...@uc.org
 




 --
 *Henry L. Coleman *
 ***Per: VoIP-PBX.ca
 *
 *
 *





-- 
*Henry L. Coleman *
***Per: VoIP-PBX.ca
*
*
*


Re: [on-asterisk] Backup and Restore

2010-12-13 Thread John Lange
In short; create this file (*  /etc/udev/rules.d/11-backup-auto-mount.rules
) *by copying and pasting the text between the start and end tags:

 --- start ---
* *
KERNEL!=sd[a-z][0-9], GOTO=backup_auto_mount_end

# Import FS infos
IMPORT{program}=/sbin/blkid -o udev -p %N

# Global mount options
ACTION==add, ENV{mount_options}=relatime
# Filesystem-specific mount options
ACTION==add, ENV{ID_FS_TYPE}==vfat|ntfs,
ENV{mount_options}=$env{mount_options},utf8,gid=100,umask=002

# Mount the device
ACTION==add, RUN+=/bin/mount -o $env{mount_options} /dev/%k
/var/lib/asterisk/backups

# Clean up after removal
ACTION==remove, ENV{dir_name}!=, RUN+=/bin/umount -l
/var/lib/asterisk/backups

# Exit
LABEL=backup_auto_mount_end

 --- end ---

You can then insert and remove your key without touching the system. (I'm
making a lot of assumptions about FreePBX that should be correct, for
example that it uses udev).

Lots more suggestions on udev rules here:

https://wiki.archlinux.org/index.php/Udev#Auto_mounting_USB_devices

-- 
John Lange
www.johnlange.ca

On Mon, Dec 13, 2010 at 4:05 PM, Henry Coleman henry.cole...@voip-pbx.cawrote:

 Thanks for all the suggestions. So far I think that Doug' solution looks
 the most promising, however
 it needs automating so that inserting the USB stick will automatically
 mount the stick and disconnection will umount the stick.
 (A sort of plug and play if you will) Restore might work also based on this
 principle.

 So I'm gonna pick your Linux brains (again) and ask if this can be done?
 Henry   [?]




Re: [on-asterisk] Backup and Restore

2010-12-13 Thread Douglas Pickett

John,
Yes, I agree.  Putting in the -t msdos  was overkill - the mount 
command is smart enough to recognize the type.

Regards,
Doug.

On 13/12/2010 4:58 PM, John Lange wrote:

Douglas had the correct solution but just leave out the -t msdos.
Mount will auto-detect the file system so no need to specify it.

If you want to get really fancy, you can setup udev to auto-mount your
usb key at the same place every time it's plugged in. That way you can
just walk up and plug it in without touching anything else.

Pretty advanced but I can write more on this if anyone is interested.




-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-18 Thread 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.


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 aster...@voip-pbx.ca

To: asterisk@uc.org
Sent: Wednesday, June 17, 2009 8:42 PM
Subject: Re: [on-asterisk] Backup and restore to a USB stick



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).

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 0253700   0% /dev/shm
/dev/sda1  2002892627960   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 aster...@voip-pbx.ca
To: asterisk@uc.org
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]
-





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org






-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-18 Thread Henry L.Coleman
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.

 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 aster...@voip-pbx.ca
 To: asterisk@uc.org
 Sent: Wednesday, June 17, 2009 8:42 PM
 Subject: Re: [on-asterisk] Backup and restore to a USB stick


 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).

 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 0253700   0% /dev/shm
 /dev/sda1  2002892627960   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 aster...@voip-pbx.ca
 To: asterisk@uc.org
 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]
 -





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-17 Thread 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).


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 0253700   0% /dev/shm
/dev/sda1  2002892627960   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 aster...@voip-pbx.ca

To: asterisk@uc.org
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]
-





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-17 Thread 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


Douglas Pickett wrote:

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 0253700   0% /dev/shm
/dev/sda1  2002892627960   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 
aster...@voip-pbx.ca

To: asterisk@uc.org
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]
-





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




--
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 

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-17 Thread Johannes Vanderknyff
And you can sell that as part of your services :) (Maintenance contracts, etc)

Johannes

On Wed, Jun 17, 2009 at 11:41 AM, Mike
Ashtonmike.ash...@qualitytrack.com wrote:
 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


 Douglas Pickett wrote:

 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 aster...@voip-pbx.ca
 To: asterisk@uc.org
 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]
 -





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org




 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



 --
 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 

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-17 Thread 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).

 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 0253700   0% /dev/shm
 /dev/sda1  2002892627960   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 aster...@voip-pbx.ca
 To: asterisk@uc.org
 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]
 -





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org




 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread Henry L.Coleman
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 aster...@voip-pbx.cawrote:

 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-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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
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.Colemanaster...@voip-pbx.ca 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 aster...@voip-pbx.cawrote:

 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-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



RE: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread Henry L.Coleman
Hi Bill as requested.

Jun 16 15:00:24 pbx kernel:   Vendor: Lexar Model: JD FireFlyRev: 
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 
tig...@veritas.com
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
 Henry:

 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-
 From: Apache [mailto:apa...@tsx3.computeradvocacy.com] On Behalf Of Henry 
 L.Coleman
 Sent: Tuesday, June 16, 2009 1:49 PM
 To: asterisk@uc.org
 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]
 -





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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
 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.Colemanaster...@voip-pbx.ca 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 
 aster...@voip-pbx.cawrote:

 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-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



RE: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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-
From: Johannes Vanderknyff [mailto:johannes.vanderkn...@gmail.com] 
Sent: Tuesday, June 16, 2009 3:13 PM
To: aster...@voip-pbx.ca
Cc: asterisk@uc.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

On Tue, Jun 16, 2009 at 3:07 PM, Henry L.Colemanaster...@voip-pbx.ca 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 aster...@voip-pbx.cawrote:

 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-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org





 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org


-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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


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:johannes.vanderkn...@gmail.com] 
Sent: Tuesday, June 16, 2009 3:13 PM

To: aster...@voip-pbx.ca
Cc: asterisk@uc.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

On Tue, Jun 16, 2009 at 3:07 PM, Henry L.Colemanaster...@voip-pbx.ca 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 aster...@voip-pbx.cawrote:

  

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-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org


-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

  


Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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:johannes.vanderkn...@gmail.com] 
Sent: Tuesday, June 16, 2009 3:13 PM

To: aster...@voip-pbx.ca
Cc: asterisk@uc.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

On Tue, Jun 16, 2009 at 3:07 PM, Henry 
L.Colemanaster...@voip-pbx.ca 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 
aster...@voip-pbx.cawrote:


 
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-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org





-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org


-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

  




--
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: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread 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

 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:johannes.vanderkn...@gmail.com]
 Sent: Tuesday, June 16, 2009 3:13 PM
 To: aster...@voip-pbx.ca
 Cc: asterisk@uc.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

 On Tue, Jun 16, 2009 at 3:07 PM, Henry
 L.Colemanaster...@voip-pbx.ca 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
 aster...@voip-pbx.cawrote:


 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-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org



 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org




 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org


 -
 To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
 For additional commands, e-mail: asterisk-h...@uc.org




 --
 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

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread Martin Glazer

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:johannes.vanderkn...@gmail.com]
Sent: Tuesday, June 16, 2009 3:13 PM
To: aster...@voip-pbx.ca
Cc: asterisk@uc.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

On Tue, Jun 16, 2009 at 3:07 PM, Henry
L.Colemanaster...@voip-pbx.ca 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
aster...@voip-pbx.cawrote:




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-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



  

-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



  

-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org


-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




--
Mike Ashton

Quality Track Intl
CTO
Ph: 647-724-3500 x 301
Cell

Re: [on-asterisk] Backup and restore to a USB stick

2009-06-16 Thread Douglas Pickett

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 aster...@voip-pbx.ca

To: asterisk@uc.org
Sent: Tuesday, June 16, 2009 3:35 PM
Subject: Re: [on-asterisk] Backup and restore to a USB stick


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
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.Colemanaster...@voip-pbx.ca 
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 
aster...@voip-pbx.cawrote:


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-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org







-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org






-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org




-
To unsubscribe, e-mail: asterisk-unsubscr...@uc.org
For additional commands, e-mail: asterisk-h...@uc.org



RE: [on-asterisk] Backup and restore Asterisk config from one host to another

2007-04-13 Thread Philip Mullis
well a good idea then for your scenario, as Remzi was saying is to use rysnc
 
depending on the setup of the 2 boxes you may only need to back a few things 
up, I take it this is for the purpose of a failover or hotspare system? 
 
remember to copy the zap config file out of /etc
 
along with all the directories that where previously mentioned in Remzi's 
email. 
 
You will also want to rsync the directory that stores your database files, and 
you will probably want to sync your log files aswell as a means of going back 
and looking for errors. 
 
 
Phil.
 
 



From: Richard (Rogers @ work) [mailto:[EMAIL PROTECTED]
Sent: Fri 4/13/2007 9:40 AM
To: Philip Mullis; asterisk@uc.org
Subject: Re: [on-asterisk] Backup and restore Asterisk config from one host to 
another


I have done all my extension setup and configuration using FreePBX.  Which 
folders need to be backup?  How about the changes saved to DB if any??
 
Thanks,
Richard

- Original Message - 
From: Philip Mullis mailto:[EMAIL PROTECTED]  
To: Richard (Rogers @ work) mailto:[EMAIL PROTECTED]  ; 
asterisk@uc.org 
Sent: Friday, April 13, 2007 9:29 AM
Subject: RE: [on-asterisk] Backup and restore Asterisk config from one 
host to another

you can scp them from one box to another, that would be the quickest 1 
liner way of doing that. 
 
Phil.
 



From: Richard (Rogers @ work) [mailto:[EMAIL PROTECTED]
Sent: Fri 4/13/2007 9:13 AM
To: asterisk@uc.org
Subject: [on-asterisk] Backup and restore Asterisk config from one host 
to another



Hi ,

I would like save a snapshot of all my asterisk configurations from one 
host
(primary )and restore it on another host (backup).
I would like to do it using a command line/script rather than using 
freePBX.

Any suggestion will be appreciated.

Thanks,
Richard


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: [on-asterisk] Backup and restore Asterisk config from one host to another

2007-04-13 Thread Ian Darwin

Richard (Rogers @ work) wrote:

Hi ,

I would like save a snapshot of all my asterisk configurations from one host
(primary )and restore it on another host (backup).
I would like to do it using a command line/script rather than using freePBX.


scp -r /etc/asterisk backuphost:/etc/asterisk

Need an additional one for the mailbox directory if you want to back up 
vmails.


Re: [on-asterisk] Backup and restore Asterisk config from one host to another

2007-04-13 Thread Richard \(Rogers @ work\)
Hi Ian,

Thanks for the direction.  This backs up all the config files and is simple
enough.
How about changes made to mySQL database?  I was under the impression that
there are config info in the database as well.

Thanks,
Richard
- Original Message - 
From: Ian Darwin [EMAIL PROTECTED]
To: Richard (Rogers @ work) [EMAIL PROTECTED]
Cc: asterisk@uc.org
Sent: Friday, April 13, 2007 10:15 AM
Subject: Re: [on-asterisk] Backup and restore Asterisk config from one host
to another


 Richard (Rogers @ work) wrote:
  Hi ,
 
  I would like save a snapshot of all my asterisk configurations from one
host
  (primary )and restore it on another host (backup).
  I would like to do it using a command line/script rather than using
freePBX.

 scp -r /etc/asterisk backuphost:/etc/asterisk

 Need an additional one for the mailbox directory if you want to back up
 vmails.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: [on-asterisk] Backup and restore Asterisk config from one host to another

2007-04-13 Thread G. Roderick Singleton
On Fri, 2007-04-13 at 10:21 -0400, Richard (Rogers @ work) wrote:
 Hi Ian,
 
 Thanks for the direction.  This backs up all the config files and is simple
 enough.
 How about changes made to mySQL database?  I was under the impression that
 there are config info in the database as well.
 
 Thanks,
 Richard

Why not use mysqldump to backup the database and scp or whatever to put
the backup archive on the backup machine?

e.g. as crontab entry like the following:
 5 5 * * *   /usr/bin/mysqldump --add_drop_table --opt --add_locks 
-udbuser -ppassword name of db | bzip2 -c  /var/backups/db_backup_`date 
-I`.sql.bz


 - Original Message - 
 From: Ian Darwin [EMAIL PROTECTED]
 To: Richard (Rogers @ work) [EMAIL PROTECTED]
 Cc: asterisk@uc.org
 Sent: Friday, April 13, 2007 10:15 AM
 Subject: Re: [on-asterisk] Backup and restore Asterisk config from one host
 to another
 
 
  Richard (Rogers @ work) wrote:
   Hi ,
  
   I would like save a snapshot of all my asterisk configurations from one
 host
   (primary )and restore it on another host (backup).
   I would like to do it using a command line/script rather than using
 freePBX.
 
  scp -r /etc/asterisk backuphost:/etc/asterisk
 
  Need an additional one for the mailbox directory if you want to back up
  vmails.
 
  -
  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]
-- 
G. Roderick Singleton [EMAIL PROTECTED]
PATH tech



smime.p7s
Description: S/MIME cryptographic signature


RE: [on-asterisk] Backup and restore Asterisk config from one host to another

2007-04-13 Thread Remzi Semsettin Turer
Unless you are storing your config into mySQL, there is nothing there, by 
default Asterisk uses the config files. You might be using it for CDR and other 
stuff, if so, it can be backed up like:

mydatabase=mydatabasename `date`.sql
filename=${mydatabase// /_}
mysqldump -h mydatabaserver.com -u username -ppassword mydatabase  
/var/backups/sqlbackup/mydbaseserver1/$filename

and copied to the other server.

-Original Message-
From: Richard (Rogers @ work) [mailto:[EMAIL PROTECTED]
Sent: Friday, April 13, 2007 10:22 AM
To: Ian Darwin
Cc: asterisk@uc.org
Subject: Re: [on-asterisk] Backup and restore Asterisk config from one host to 
another

Hi Ian,

Thanks for the direction.  This backs up all the config files and is simple
enough.
How about changes made to mySQL database?  I was under the impression that
there are config info in the database as well.

Thanks,
Richard
- Original Message -
From: Ian Darwin [EMAIL PROTECTED]
To: Richard (Rogers @ work) [EMAIL PROTECTED]
Cc: asterisk@uc.org
Sent: Friday, April 13, 2007 10:15 AM
Subject: Re: [on-asterisk] Backup and restore Asterisk config from one host
to another


 Richard (Rogers @ work) wrote:
  Hi ,
 
  I would like save a snapshot of all my asterisk configurations from one
host
  (primary )and restore it on another host (backup).
  I would like to do it using a command line/script rather than using
freePBX.

 scp -r /etc/asterisk backuphost:/etc/asterisk

 Need an additional one for the mailbox directory if you want to back up
 vmails.

 -
 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]