Page 1 of 2
archive server
Posted:
Mon Aug 12, 2013 8:42 am
by richardroi
Support,
I was planning to backup all recordings to an archive server.
Do you have any thread that can guide me.
Just 1 all in one server + 1 archive server for backup recordings and client access.. (this will be my setup)
The recordings will still be available on the main server. how can I achieve this?
Thank you.
Re: archive server
Posted:
Mon Aug 12, 2013 1:47 pm
by williamconley
look at the vicibox installation manual. it has instructions for archive server.
Re: archive server
Posted:
Mon Aug 12, 2013 2:13 pm
by richardroi
Done installing the two servers. Problem is connecting both of them. On my main server when i click report I only see the main server. the archive is not there. any adjustments needed on both servers?
Thank you.
Re: archive server
Posted:
Mon Aug 12, 2013 2:22 pm
by richardroi
Recording Web Link: Server_IP
Alternate Recording Server IP:
Do i need to touch these entries on modify server?
How about on crontab?
Re: archive server
Posted:
Mon Aug 12, 2013 3:37 pm
by richardroi
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
ftp: Login failed.
ftp>
Im having this error when i ran ftp 192.168.XXX.XXX
Re: archive server
Posted:
Mon Aug 12, 2013 3:38 pm
by williamconley
when you installed the second server, your "quiz" would have allowed it to become part of the cluster. if you did not follow instructions for adding a new server to the cluster, you now have two unrelated servers. still doable, but more work. mostly: are there instructions for this in the vicibox installation manual? and have you read it?
be sure to use the Standard install .iso for clustering and not the Preload.
Re: archive server
Posted:
Mon Aug 12, 2013 3:47 pm
by richardroi
Read the manual, no instruction there for archive server. and yes in the selection of Y or N on the second server I only choose archive server then it asked for the IP of the main server. On the main server for the selection of Y or N, all is YES except for " will this be used as an archive server" I answered no. Standard cd used.
Re: archive server
Posted:
Mon Aug 12, 2013 4:57 pm
by williamconley
In that case, you still may have to complete the archive install portion (which may require another command line execution).
Note that this type of server will not appear under "servers" most likely because it's not a dialer or a db server.
Re: archive server
Posted:
Mon Aug 12, 2013 4:59 pm
by richardroi
Im redoing the archive server, might miss something.
Thanks.
Re: archive server
Posted:
Mon Aug 12, 2013 5:25 pm
by richardroi
questions: do i have to put the archive ip on alternate recording ip on webgui? and what to touch on crontab -e? ftp is disabled by default i think.
Thank you.
Re: archive server
Posted:
Mon Aug 12, 2013 6:23 pm
by richardroi
was able to login!
main:~ # ftp 192.168.150.191
Connected to 192.168.150.191.
220 (vsFTPd 3.0.2)
Name (192.168.150.191:root): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
I used "chmod a-w /home/archive"
Now. how to test it? Whats next?
I think i have to enable it on crontab?
Anyone?
Re: archive server
Posted:
Mon Aug 12, 2013 6:26 pm
by williamconley
When Vicidial's recording scripts have "ftp-transfer" enabled, the transfer process will alter the link in the recordings table to the new location at the moment of transfer. So no changes are required aside from the settings in the astguiclient.conf file and activation of the ftp-transfer script. It will use the information in the astguiclient.conf file to build the new link url.
Be sure to test it with a single record and verify it's Linked on the Lead Record before you try a full run. You can execute the ftp transfer script and restrict it to a single record if you like.
Best, however, to do all this in a virtual system several times so you can screw it up and affect ... nothing. Reset and try it again.
Re: archive server
Posted:
Mon Aug 12, 2013 7:04 pm
by williamconley
look up the script and how it is normally executed in crontab -e.
execute it at the command line with "--help" added to get Options.
Re: archive server
Posted:
Tue Aug 13, 2013 9:30 am
by richardroi
Thanks William.
Can i use a my backup server ( running but no agents logged in), it has the old recordings on it, want to try if it will transfer the recordings to my archive server? If it is possible, I think I just have to edit the DB server ip on astguiclient on my archive server right? and run the script.
Re: archive server
Posted:
Tue Aug 13, 2013 11:02 am
by richardroi
Should i enable all scripts on ### recording mixing/compressing/ftping scripts
This one is disabled #0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
Thank you.
Re: archive server
Posted:
Tue Aug 13, 2013 12:14 pm
by richardroi
- Code: Select all
vsftpd[1295]: [admin] OK LOGIN: Client "192.168.150.98"
2013-08-13T22:56:06.691097+08:00 cluster2 vsftpd[1295]: [admin] FAIL MKDIR: Client "192.168.150.98", "/2013-08-13"
2013-08-13T22:56:06.695719+08:00 cluster2 vsftpd[1295]: [admin] FAIL UPLOAD: Client "192.168.150.98", "/20130813225112_100_101-all.mp3", 0.00Kbyte/sec
I have this on my logs? any ideas? anyone?
Re: archive server
Posted:
Wed Aug 14, 2013 7:33 am
by DomeDan
I guess permission problems, check the permissions and try to manually put some files on the vsftp server with the actual user login that the script uses
Re: archive server
Posted:
Wed Aug 14, 2013 8:15 am
by akmayuga
Hi Domedan,
I guess permission problems, check the permissions and try to manually put some files on the vsftp server with the actual user login that the script uses
good day, may i know how to "check the permissions" .
thanks you
Re: archive server
Posted:
Wed Aug 14, 2013 8:33 am
by DomeDan
You should start a new thread if its not the same problem you have,
usually an other user login means a separate problem.
file/dir permissions can be seen with the command "ls -l" read more about permissions on a random result on google:
http://www.linuxquestions.org/linux/ans ... ermissionsthe user that logs in to vsftp server (in this case "admin" it seams) needs to have permissions to the directory where the user upload files (here it seams: /home/archive)
login with admin with an ftp client and try to create a directory and upload files
Re: archive server
Posted:
Wed Aug 14, 2013 9:04 am
by akmayuga
Hi DomeDan,
I'm Sorry, I forgot to mention that I'm working with richardroi.
- Code: Select all
ftp 192.168.150.191
Connected to 192.168.150.191.
220 (vsFTPd 3.0.2)
Name (192.168.150.191:root): admin
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||30925|).
150 Here comes the directory listing.
drwxr-xr-x 2 ftp ftp 4096 Aug 14 13:25 Recordings
226 Directory send OK.
ftp>
is this what I need to edit??
- Code: Select all
drwxr-xr-x 2 ftp ftp 4096 Aug 14 13:25 Recordings
thank you
Re: archive server
Posted:
Wed Aug 14, 2013 11:43 am
by richardroi
I believe the problem is the script. I tried manually putting file on it using winscp (ftp) same username and password that i setup and it worked.
- Code: Select all
### recording mixing/compressing/ftping scripts
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl
1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3
2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --MP3
0 1 * * * /usr/share/astguiclient/AST_CRON_audio_4_ftp2.pl --ftp-server=192.168.150.191 --ftp-login=admin --ftp-pass=admin1234 --ftp-directory=/home/archive/Recording$ --ftp-persistent --ftp-validate --transfer-limit=100000 --list-limit=100000
here is my crontab -e entry for recordings and ftping.
Thank you.
Re: archive server
Posted:
Wed Aug 14, 2013 5:13 pm
by richardroi
Still no go! What am i missing? Why the recordings are not transferring to archive server?
Anyone? Kindly help. Can somebody share their configurations?
Thank you.
Re: archive server
Posted:
Thu Aug 15, 2013 6:03 am
by DomeDan
in crontab you got a $ sign instead of a letter s:
--ftp-directory=/home/archive/Recording$
should be
--ftp-directory=/home/archive/Recordings
and make sure that /home/archive/Recordings is the correct path
in ftp client you can probably use the pwd command to find out where you are
Re: archive server
Posted:
Thu Aug 15, 2013 11:18 am
by richardroi
We got it working, path error! I was missing "/" on my crontab " --ftp-directory=/Recordings"
and on my astguiclient "VARFTP_dir => /Recordings" it should have "/" also.
Thank you for all your help.
Re: archive server
Posted:
Thu Aug 15, 2013 12:27 pm
by richardroi
Question: if the archive server fails, where will the recordings go? will it stays on the main server? will it shows error?
then if i put a new archive server will it transfer all the recordings again including the old ones or just the new ones with the same date when you set up the archive server.
Are the old recordingss that should be erased within 7 days (24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f)is in the ftp2 folder? am i correct?
Because the script is moving the recordings immediately, it would no longer be available through the gui? right? how can I set it with a given time?
Is it possible to have a copy on the main server for say 3 months but the ftping is as it is?
Re: archive server
Posted:
Thu Aug 15, 2013 2:38 pm
by DomeDan
Nice, thought the ftp-directory needed the full path, well well good you had it solved!
If the server fails then the script ftping the files will fail, I dont know if it will tell you about it, only in the root mail maybe
or maybe there is some mail function that will send you a mail, dont know, im not using that script
I'll let someone else that uses those scrips answer your questions.
but isnt the script updating the file location in the database so you can listen to the recordings (in the vicidial gui) when they are stored in the archive?
Re: archive server
Posted:
Thu Aug 15, 2013 2:46 pm
by richardroi
Thank you DomeDan. This is my first time running the script, and I'm running it on test server.
Hope someone will answer me...but i hope it will update the file location on the gui.
Re: archive server
Posted:
Mon Mar 03, 2014 11:24 am
by richardroi
one quick question! I've been using the server for 8 months now, if I run the ftp settings now will it transfer all the recordings (from the start)or just the recordings that was made when i enabled the ftp?
Re: archive server
Posted:
Tue Mar 04, 2014 5:22 am
by boybawang
basically it will transfer all the recordings under the chosen format you have saved it like MP3 to FTP then it uploads it to the ftp server on the specific date which it was made unless date archiving is disabled
Re: archive server
Posted:
Tue Mar 04, 2014 9:09 am
by richardroi
Thank you boybawang. Maybe you can share some settings. I wanted to ftp all the recordings to an archive server for storage, but I don't want the system to update its url on user stats, so when you click the recordings the url will still point it to the ip of the main server not the ip of the archive.
Thank you in advance kabayan.
Re: archive server
Posted:
Wed Mar 05, 2014 4:45 am
by DomeDan
you can solve this with the rsync command and schedule it with cron
Re: archive server
Posted:
Wed Mar 05, 2014 7:08 am
by richardroi
Thank you. But I'm not familiar with rsync command. Can you elaborate more? How to set it up? And will it folder the recordings by date?
Re: archive server
Posted:
Wed Mar 05, 2014 11:21 am
by williamconley
rsync documentation is available via "rsync --help" or "man rsync". LOL
a simple "copy this crap to this other location":
- Code: Select all
rsync -avHK --delete /root/backup root@11.11.1.111:/root/backups/vici27
This will take all the files from the root/backup (local) folder and put them in the root/backups/vici27 folder on 11.11.1.111 and will log in via ssh as the "root" user on that computer to move the files. It will also delete any files at that location that are not in the original location (may not be desirable for your purposes ... but this is an example).
Note that rsync makes no changes to folders or anything else, it just copies A to B based on criteria as configured.
If you want "folders", use the ftp file copier. It is the "commented out" 4th or 5th line of the audio manipulation section in crontab -e. The script resides in /usr/share/astguiclient and "help" is available by executing the script with " --help" added to the end for the available options.
Re: archive server
Posted:
Wed Mar 05, 2014 11:56 am
by richardroi
Thanks again William, this is more complex and not what i need, ill be sticking with the ftp settings. Will try again, and keep you guys posted. Thank you.
Re: archive server
Posted:
Wed Mar 05, 2014 4:21 pm
by richardroi
Still no go! "I wanted to ftp all the recordings to an archive server for storage, but I don't want the system to update its url on user stats, so when you click the recordings the url will still point it to the ip of the main server not the ip of the archive"
kindly help!
Re: archive server
Posted:
Thu Mar 06, 2014 4:23 am
by DomeDan
Ok, looked a bit at the scripts and if you are using AST_CRON_audio_3_ftp.pl then just comment out these 3 rows: (put a # in the beginning on the row, make a backup first!)
- Code: Select all
$stmtA = "UPDATE recording_log set location='$VARHTTP_path/$start_date_PATH$ALLfile' where recording_id='$recording_id';";
if($DB){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
in AST_CRON_audio_4_ftp2.pl those rows are already commented out
depending on what version you are using..
Re: archive server
Posted:
Thu Mar 06, 2014 7:53 am
by richardroi
Hi DomeDan,
Thank you, I tested your advice, it is now not updating the url on recordings in user stats, but it is not ftping also to my archive server, do i have to remove the comments (#) on /usr/share/astguiclient/AST_CRON_audio_4_ftp2.pl? or I am missing something?
Re: archive server
Posted:
Thu Mar 06, 2014 8:01 am
by richardroi
my Mistake!!! Thank you! working now!!! it will not affect anything right? just the url on the user stats? just want to be sure before I set it up on production.
Re: archive server
Posted:
Thu Mar 06, 2014 8:23 am
by richardroi
oopsss. "object not found" error 404, when i click the url recordings on user stat.
I think this is happening after converting the file recording and ftp it to the archive. How can I make it work that it will still play the file on user stats?
Please advice!
Re: archive server
Posted:
Thu Mar 06, 2014 8:38 am
by richardroi
Found the error!
http://192.168.150.152/RECORDINGS/MP3/1234577345620140306-211815richardroi-all.mp3
it should be
http://192.168.150.152/RECORDINGS/FTP/1234577345620140306-211815richardroi-all.mp3
Am i Right? how can i do that for me to download the recordings. Or is there a way that the
file will stay on the folder depending on the file extension i used (MP3 folder or GSM folder on monitorDone). and will automatically delete it for example after 3 months.
### remove old recordings more than 7 days old, and delete originals after 1 day
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f
-mtime +7 -print | xargs rm -f ( this will increase the number of days)
24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -
mtime +1 -print | xargs rm -f