Syed Jahanzaib Personal Blog to Share Knowledge !

November 16, 2011

MySQL DB & HTML files Backup Script


LAST UPDATED:  13-Dec-2017

Following is a customized backup script [Made for Ubuntu] to create backup of your mysql DB and HTML files.  It creates FULL Backup of all configuration files related to RM & mysql database (radius) in local storage, you can connect your USB or secondary HDD. You can also configure cloud like DROPBOX so that copy of backup should be copied to CLOUD as well, MOST RECOMMENDED.

NOTE: Using S.S.D disk (or raid) are highly recommended as there are less chances of  media failure, and above all read/write rates is incredibly good. If you have configured RAID , then it will provide redundancy as well.

Modify the script as per your requirements …

  • I am using KANNEL as sms gateway & sendEmail app to send email via GMAIL.
  • It will make a copy of files in USB disk mounted at /USB folder
  • It will also delete files older then 30 days
  • It will send email and SMS with details
  • all backups will be saved in /backup folder

Please be-aware that I sometimes modify this file as per network requirements, so you may see revisions in this file. This is just an sample dummy, you can add remove any function in this script as per your requirements 🙂 ~ zaib

Let’s Start …


First create temp folder and create script in it.

mkdir /temp
cd /temp
touch fullbackup.sh
chmod +x fullbackup.sh

Now open the file

nano /temp/fullbackup.sh

and paste the following code.

#!/bin/bash
# set -x
# Version 1.1 / 10th January, 2014
# Last Modified / 17-DEC-2017
# Syed Jahanzaib / Web: https://aacable.wordpress.com / Email: aacable@hotmail.com
# This script creates FULL Backup of MySQL DB (Radius) and MYSQL DBR related DATA files.
# We can adjust it to do incremental basis backup too, but I based on my personnel experiences, I prefer to have FULL backup instead of incremental,
# Because you never know what you will going to need in case of disaster recovery
# Adjust below DATA fields accordingly. remove / add desired folders.
# Settings various VARIABLES for the script
clear

# Colors Config . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"

# Following is only www RADIUS HTML FILES, mysqldb is separate from this, will come later in the script with mysqldump
# change target to match your's like /var/www/html
TARGET="/var/www  /sql_backup"
SAVEDIR_FULL="backup"
# IF YOU WANT BACKUP TO BE COPIED IN LOCAL FOLDER ALONG WITH USB AS WELL.
# UNCOMMENT FOLLOWING
#USBDEVICE="sdb1"
#USB="usb"

# Temporay folder where sql backup file will be replaced temporary
SQL_DIR="sql_backup"
radpwd="ROOT_PASS_OR_RADIUS_USER_PASS"

#MYSQL DETAILS
SQLUSER="root"
SQLPASS="ROOTPASS"

#LOG FILE, IF REQUIRED
LOG="/var/log/fullbackup.log"

#SET DATE TIME
set $(date)
time=`date |awk '{print $4}'`
DT=`date +%d.%b.%Y__time_%H.%M`
YESTERDAY=`date --date='yesterday' +%Y-%m-%d`

#GMAIL Details
GMAILID="yourgmail@gmail.com"
GMAILPASS="GMAILPASS"
ADMINMAIL1="TO1@hotmail.com"
ADMINMAIL2="TO2@hotmail.com"
COMPANY="ZAIB TECH (Pvt) Ltd."
SMTP="64.233.184.108:587"

# KANNEL SMS Gateway Details if you want to send SMS using Local KANNEL sms gw
KHOST="192.168.0.1"
KID="kannel"
KPASS="KANNEL_PASSWORD"
CELL1="03333021909"
CELL2="01234567890"
RMBACKUPSMSFILE="/tmp/rmbackupsms.txt"
> $RMBACKUPSMSFILE

# START the BACKUP PROCESS ... #######

# Start counting start time
start_time=`date +%s`
echo -e "$COL_RED Welcome ! This is Radius Manager Backup Script, It will take backup of RADIUS Database and FoldersFollowing ...
$TARGET
Backup started at $6-$2-$3 Time $time . . .

Powered by Syed.Jahanzaib $COL_RESET"

# Checking if $SAVEDIR_FULL folder is previously present or not . . .
{
if [ ! -d "/$SAVEDIR_FULL" ]; then
echo
echo
echo -e "$COL_RED $SAVEDIR_FULL folder not found, Creating it so all backup's should be placed there . . . $COL_RESET"
mkdir /$SAVEDIR_FULL
else
echo
echo -e "$COL_GREEN ********* /$SAVEDIR_FULL folder is already present , so no need to create it, Proceeding further . . . $COL_RESET"
fi
}

# Checking if $SQL_DIR folder is previously present or not . . .
{
if [ ! -d "/$SQL_DIR" ]; then
echo
echo
echo -e "$COL_RED /$SQL_DIR folder not found, Creating it MSQL EXPORT/DUMP backup should be placed there . . . $COL_RESET"
mkdir /$SQL_DIR
else
echo
echo -e "$COL_GREEN ********* /$SQL_DIR folder is already present , so no need to create it, Proceeding further . . . $COL_RESET"
fi
}

# Checking if USB Is mounted or not...
#USBCHK=`mount |grep usb`
#if [ -z "$USBCHK" ]; then
#echo "USB is not mounted !!"
#echo "Mounting USB now..."
#mkdir /$USB
#mount -t auto /dev/$USBDEVICE /$USB
#else
#echo "USB is mounted ! OK"
#fi

#{
#if [ ! -d "/$USB" ]; then
#echo -e "$COL_RED /$USB folder not found, Creating it. . . $COL_RESET"
#mkdir /$USB
#else
#echo -e "$COL_GREEN ********* /$USB folder is already present , so no need to create it, #Proceeding further . . . $COL_RESET"
#fi
#}

# Creating MYSQL dump of databases
echo -e "$COL_GREEN ********* Exporting MYSQL DUMP to $SQL_DIR ... $COL_RESET"
mysqldump -u$SQLUSER -p$SQLPASS radius > /$SQL_DIR/mysql_db_full_$DT.sql

# GZIP MYSQL D.B
# TAR GZIP (mysql)
echo -e "$COL_GREEN ********* TAR - Compressing all Backup Folders to $SAVDIR_FULL ... $COL_RESET"
FILENAME="$DT.__radius_backup.tgz"
tar cfzv /$SAVEDIR_FULL/$FILENAME $TARGET
cp -vr /$SAVEDIR_FULL/$FILENAME /$USB

# Deleting sql db from $SQL_DIR because its zipped with the above command already and now all data available in single file : )
rm -fr /$SQL_DIR/*
echo

# Print END time
echo "MAIN Backup ended at $6-$2-$3 Time $time"
echo -e "$COL_GREEN ********* Backup completed to /$SAVEDIR_FULL ... $COL_RESET"
echo -e "$COL_RED Backup ended at $6-$2-$3 Time $time . . . $COL_RESET"
end_time=`date +%s`

# Delete files older then 30 days, ONLY IF /$SAVDIR_FULL EXISTS, FOR FAIL SAFE , CHECK
echo "Deleting Older files then 30 days from $SAVEDIR_FULL and /$USB, to save disk space . . ."
{
if [ -d "/$SAVEDIR_FULL" ]; then
find /$SAVEDIR_FULL/* -mtime +30 -exec rm {} \;
fi
}
#{
#if [ -d "/$USB" ]; then
#find /$USB/* -mtime +30 -exec rm {} \;
#fi
#}

# Print Complete Timings
echo MAIN Backup Completion Time was `expr $end_time - $start_time` s.
# CHECK FILE SIZE AND COMPARE, IF ITS LESS , THEN ALERT
SIZE=`ls -lh /$SAVEDIR_FULL/$FILENAME | awk '{print $5}'`
SIZEB=`ls -l /$SAVEDIR_FULL/$FILENAME | awk '{print $5}'`

if [ $SIZEB -lt 1 ]
then
echo "FAILED FAILED FAILED"
RESULT="FAILED FAILED FAILED!!"
else
echo "SUCCESSFULL!"
RESULT="SUCCESSFULL"
fi

# PRINT INFO SECTION #########
# Print Fetched Information on Screen , for info to see

echo "Radius INFO: Backup OF Radius for $YESTERDAY is $RESULT.
Target Folders = $TARGET
File Name = /$SAVEDIR_FULL/$FILENAME
Size = $SIZE
Backup Completion Time was `expr $end_time - $start_time` s.

$COMPANY
Powered by Syed Jahanaib"

############## SMS SECTION ##############
echo "Radius INFO: Backup OF Radius for $YESTERDAY is $RESULT.
Target Folders = $TARGET
File Name = /$SAVEDIR_FULL/$FILENAME
Size = $SIZE

Backup Completion Time was `expr $end_time - $start_time` s.

$COMPANY
Powered by Syed Jahanaib" > $RMBACKUPSMSFILE

# Send SMS Alert via KANNEL
echo "Sending of EMAIL/SMS ALERT is disabled as this scheudle will run every 2 hours, and will generate many sms/emails ... zaib"
#echo "Sending SMS ALERT to $CELL1 & $CELL2 ..."
#curl "http://$KHOST:13013/cgi-bin/sendsms?username=$KID&password=$KPASS&to=$CELL1+$CELL2" -G --data-urlencode text@$RMBACKUPSMSFILE

# EMAIL SECTION ##############
# Make sure you install sendEMAIL tool and test it properly before using email section.
#SEND EMAIL Alert As well using sendEMAIL tool using GMAIL ADDRESS.
# If you want to send email , use below ...
#echo ""
#echo "Sending SEMAIL ALERT to $ADMINMAIL1 & $ADMINMAIL2 ..."
#sendemail -t $email -u "Radius Backup Info for $YESTERDAY / Size=$SIZE" -o tls=yes -s $SMTP -t $ADMINMAIL1 -xu $GMAILID -xp $GMAILPASS -f $GMAILID -o message-file=$RMBACKUPSMSFILE -o message-content-type=text
#sendemail -t $email -u "Radius Backup Info for $YESTERDAY / Size=$SIZE" -o tls=yes -s $SMTP -t $ADMINMAIL2 -xu $GMAILID -xp $GMAILPASS -f $GMAILID -o message-file=$RMBACKUPSMSFILE -o message-content-type=text

# Print Credits : )
echo -e "$COL_GREEN ********* Syed Jahanzaib / aacable@hotmail.com / https://aacable.wordpress.com $COL_RESET"


Now execute this script  & see if any error occurs

/temp/fullbackup.sh

 


HOWTO SCHEDULE THE SCRIPT TO RUN ON DAILY BASIS

To run this file on daily basis (at 00:00 hours),
Open terminal, (make sure you are logged in with the root user.
type

crontab -e

(if it asks for text editor, select nano ,)

Now paste following code …

@daily  /temp/fullbackup.sh          # Run Daily in night at 00:00 hours

Save & Exit:

Now, based on above selection, cron job will run this command at selected scheduled timings and clear any memory cache


TIP: Remove files older than xx days

When you will implement this script, it will backup every day, and continue to do so, and its a good idea to remove backup files older then 1 month, to save disk space otherwise one day it will chew whole disk space 😀
You can add following in the same backup script at end, so that whenever it will execute backup script, it will delete older files too

echo Deleting Older files then 30 days, to save disk space
# echo Deleting Older files then 30 days, to save disk space  >> /var/log/fullbackup.log
find /backup/* -mtime +30 -exec rm {} \;

 > SCRIPT   EXECUTION   RESULT … [old sample result]

 

b2

> EMAIL   ALERT   EXECUTION … [13-dec-2017 live sample]

 

mail backup sample

> SMS   ALERT   EXECUTION … [old sample]

 

2016-05-29 05.32.34


Regard’s
Syed Jahanzaib

101 Comments »

  1. Really great, thanks from spain 😀

    Like

    Comment by kbzajunior — November 19, 2011 @ 2:44 AM

  2. AWSOME work boss!

    Like

    Comment by shohaib — November 25, 2011 @ 9:17 PM

  3. good work

    Like

    Comment by Shakir — November 27, 2011 @ 12:29 PM

  4. Bro As salamu Alaikum how r u doing.. hope u fine.. bro if i upgrade radius 3.8 to 3.9 will remove crack lcience automatically ? or i can upgarde doesnt mattter about licece.. pls reply

    Thanks
    Take care

    Like

    Comment by Tanz — December 4, 2011 @ 7:36 AM

    • I am not sure about it. I guess you can upgrade.
      How you have manage to get crack for 3.8?

      Like

      Comment by Pinochio~:) — December 4, 2011 @ 10:26 AM

    • bro, can u please give me crack version as well or provide me a link where i can download it.
      thanks,
      Nomi
      funwithnomi@yahoo.com

      Like

      Comment by nomi — November 21, 2012 @ 9:23 PM

    • Hello bro,
      Can I get the cracked version of RM 3.8. My email arjuneu@gmail.com

      Like

      Comment by Arjun Neupane — March 9, 2014 @ 7:04 PM

  5. Is’t possible to re-post or send a link of script above! Thanks.

    Like

    Comment by elabdula — March 20, 2012 @ 3:09 AM

  6. hello bro,
    can you send the script above please. my email id is : raazive2005@yahoo.com
    thanks
    raziv ferdous

    Like

    Comment by Ferdous A Ferdous — March 24, 2012 @ 11:29 AM

  7. Can you please send me script to on my e-mail: elvir75@yahoo.com. Thanks!!!

    Like

    Comment by elabdula — March 26, 2012 @ 1:35 AM

  8. Dear Syed bhai,
    Please send this mail to my email id contact@hansinindia.com

    Thanks

    Like

    Comment by hansin — May 5, 2012 @ 10:12 PM

  9. Dear Syed ,
    Please sent into my email agashi@hotmail.it

    Like

    Comment by Dana — May 19, 2012 @ 2:05 AM

  10. agashi@hotmail.it , do i need it just to do just the script rwx/chmod 755 and add at crontab or to do anything else ?
    i would be thankfull if i had any other information

    Like

    Comment by Albadi — May 21, 2012 @ 1:48 AM

  11. can anyone send me script to my email ? its removed mehdi.dbx att gmail dot com

    Like

    Comment by mehdi — May 28, 2012 @ 5:40 PM

  12. hello can i have the radius manager script please !

    this is my email :: iraq4h@gmail.com

    and thanks

    Like

    Comment by Khalid — May 31, 2012 @ 1:09 AM

  13. aslam-alikum..
    can you send me the script as well ..regards
    adilmalik77@gmail.com
    thanks

    Like

    Comment by adil — June 16, 2012 @ 3:27 AM

  14. Hi, kindly avail me of the script referenced above. endyaccess@yahoo.com. regards,

    Like

    Comment by Endy — June 26, 2012 @ 11:44 PM

  15. hi please can you send me the script alternetwifi@hotmail.com

    Like

    Comment by javier alarcon — July 23, 2012 @ 12:43 AM

  16. Selam,

    Did somebody get that sciprt ?

    Like

    Comment by Ed — August 30, 2012 @ 7:29 PM

  17. hello , Syed
    can you send the script above please. my email id is : abraham1201@hotmail.com
    thanks from venezuela.

    Like

    Comment by Abraham — September 10, 2012 @ 11:13 PM

  18. Hi can you send me the script? My email is peanutbutter.gun@gmail.com
    Thank you!

    Like

    Comment by Bob — September 11, 2012 @ 2:01 AM

  19. Please send me the script …. My email arjuneu@gmail.com

    Like

    Comment by Arjun Neupane — September 19, 2012 @ 7:20 AM

  20. plz plz plz plz plz send me on myeishvar@gmail.com

    Like

    Comment by myeishvar — September 28, 2012 @ 6:50 AM

  21. please could I have a copy of script
    Many thanks
    BTW excellent blog!!!
    david@v-satellite.com

    Like

    Comment by David — October 15, 2012 @ 8:47 PM

  22. arena-net@live.com plz

    Like

    Comment by Senca — October 21, 2012 @ 11:27 PM

  23. Hi sir can you please email me the radiusmanager backup script wan’t to use it in test environment.My email is lascel1@yahoo.com
    thanks in advance

    Like

    Comment by Lascel — October 22, 2012 @ 11:50 AM

    • Hello again sir
      I’m very new to the linux environment and would really like you to guide me in the right direction.I have received your mail with the backup script but has no clue as to where and how to add the script to my linux machine.Would really appreciate it iff you can email me again with the relevant information.
      Thanks
      Les

      Like

      Comment by Lascel — October 22, 2012 @ 5:45 PM

  24. Syed bhai,

    Please send me the link also hi_sharoff@hotmail.com

    thanks

    Like

    Comment by himanshu — November 19, 2012 @ 7:27 AM

  25. Dear Syed ,
    Please sent into my email Shah_742@yahoo.com

    Like

    Comment by Manzor — November 24, 2012 @ 12:35 PM

  26. Syed,

    Could you please send me some info for this? asmozre@gmail.com

    Thanks,

    DJ

    PS. Been reading your blog, you’ve got some wonderful info

    Like

    Comment by DJ — November 25, 2012 @ 9:44 AM

  27. Please sent me crack version or link of Radius Manager —
    email : lotus6699@gmail.com

    Like

    Comment by RAJ — November 25, 2012 @ 5:24 PM

    • Hi sir i tried many times to post a question on your blog but I don’t know what going out I can’t see any of my post maybe i’m doing error some where

      > >

      Like

      Comment by maxwellnina — November 26, 2012 @ 1:29 AM

    • no support for crack versions.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — November 27, 2012 @ 12:16 PM

    • WE CAN SHARE THE AMOUNT OF RADIUS MANAGER 4 for educational purpose those who interested contact me.
      lotus6699@gmail.com

      Like

      Comment by RAJ — December 18, 2012 @ 4:27 PM

  28. can you send me merisokanovic@hotmail.com pleaseeee

    Like

    Comment by meris — December 2, 2012 @ 5:01 PM

  29. Please send me the script …. My email selver.kryeziu@gmail.com

    Like

    Comment by selver — December 11, 2012 @ 2:40 AM

  30. aslam-alikum..
    can you send me the script as well ..regards
    jackobarca@gmail.com
    thanks

    Like

    Comment by jackobarca — January 25, 2013 @ 4:22 AM

  31. aslam-alikum…
    i am new person of ubuntu .now iam installing your guideness of dma softlab rm.but installing process i have some command problems please send my email me full details of commands please..please

    Like

    Comment by prasad — January 27, 2013 @ 10:15 AM

  32. Bhai As salamu Alaikum allah sy umeed karta hon k app khairyat sy hongay allah aap ko lambi umer de allah app ko or ap k gar walo ko khush rakhay manay aap k blog sy bohat kuch seekha hay..
    Bhai aap meje yeh script send kar de mere be khwaish k may es ko istemal karon thanks 2 u
    Regrad
    Mr.Rafiullah
    softmaster915@gmail.com

    Like

    Comment by rafiullah — February 5, 2013 @ 11:16 PM

  33. salam alaikom syed,
    please can you send me the script ?
    its.__.me@hotmail.com

    Like

    Comment by Hussein — February 23, 2013 @ 8:58 AM

  34. hello dear,
    can you send the script above please. my email id is : gentel2277@gmail.com
    thanks

    Like

    Comment by Ahmed — March 7, 2013 @ 5:10 AM

  35. Good day. Can you please email the backup script to riaan@griesels.za.net. I have to thank you for a GREAT informative blog!

    Like

    Comment by Riaan — March 24, 2013 @ 12:35 PM

  36. Can you please email the backup script to gentel2277@gmail.com
    thanks

    Like

    Comment by Ahmed — March 25, 2013 @ 3:41 PM

  37. Hello sir can you send me the script me on abid.kadiwala@gmail.com?

    Like

    Comment by Abidali Kadiwala — April 27, 2013 @ 11:24 PM

  38. Hi señor Sayed please could be possible to also have this script at m.fossua@gmail.com thanks a lot

    Like

    Comment by Marcel Fossua — May 26, 2013 @ 3:20 AM

  39. can you send me the script ? deltaelb@hotmail.com

    Like

    Comment by ALi — June 26, 2013 @ 1:05 AM

  40. Dear Aslam o Alikum to All.

    Koi bata sakhta he ke script kiss cheez ka tha.lagta he linux based script tha ek comment parhe jiss me chmod ke cmd use ke he…

    akhir ham se koi share karega he ye scrpt kiss cheez ka tha..

    thanks

    Like

    Comment by Rashdi Samoo — September 15, 2013 @ 10:13 PM

  41. Can i have the backup script too… please patrick at 100fil dot ca
    Thanks!

    Like

    Comment by caspat99 — October 9, 2013 @ 5:29 PM

  42. everything is working fine i just need the cracked or trail license here : ifran_xion@yahoo.com
    so please email me 🙂

    thank you.

    Like

    Comment by Ifran Xion — November 22, 2013 @ 12:07 PM

  43. hi
    Can i have the backup script please?
    Good work on installin RM.
    Thnx

    Like

    Comment by hello — December 28, 2013 @ 5:44 PM

  44. Hi sir can you please send me customization of radius manager look.wifiproducts@yahoo.com

    Like

    Comment by prasad — December 29, 2013 @ 7:52 PM

  45. Hi Bro;

    Please sent me backup script please. How would appreciate if you could also give brief information about’ll use.
    zekisanli31@gmail.com

    Like

    Comment by Zeki SANLI — January 6, 2014 @ 1:34 AM

  46. Hi Sir,

    where is the line to put email after file already backup sent to email as a copy too?

    Like

    Comment by arul — April 4, 2014 @ 12:30 PM

  47. Hi Syed, one questions.

    Because it gives this error

    root@debian7:/home/jc# dpkg -i libltdl3-dev_1.5.24-1ubuntu1_i386.deb
    (Reading database … 45236 files and directories currently installed.)
    Unpacking libltdl3-dev (from libltdl3-dev_1.5.24-1ubuntu1_i386.deb) …
    dpkg: error processing libltdl3-dev_1.5.24-1ubuntu1_i386.deb (–install):
    trying to overwrite ‘/usr/share/aclocal/ltdl.m4’, which is also in package libtool 1.5.26-5
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Errors were encountered while processing:
    libltdl3-dev_1.5.24-1ubuntu1_i386.deb
    root@debian7:/home/jc#

    Thansk

    S:O: Debian 7.5

    Note: All the installations are correct

    Like

    Comment by Juan Carlos — June 17, 2014 @ 11:50 PM

  48. Thanks Dear brother Jahanzaib.
    Excellent work.

    Like

    Comment by Hisham N Ali — December 31, 2014 @ 1:18 PM

  49. Hi Syed, good work, The backup run fine but with generating fullbackup.log File does, as I do the restore?

    Like

    Comment by Juan Carlos — February 1, 2015 @ 9:34 AM

  50. how can i take back of RM in centos

    Like

    Comment by Pawan Sharma — March 24, 2016 @ 9:12 AM

  51. I am having problem after restoring the backup,after my server crash.
    In new server Users login very slow and mysql using full cpu..(checked by top)

    Pls help..ranjitmandal85@yahoo.in

    Like

    Comment by Ranjit — August 15, 2016 @ 1:39 AM

  52. Hi
    Sql Dump Is not download proper in this Backup Script Version 1.

    Like

    Comment by Chirag — February 2, 2017 @ 6:20 PM

    • What problem you are getting?

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — February 3, 2017 @ 8:18 AM

      • Hi,

        I am getting backup through this Script but mysql dump is wrong. this mysql dump is restore the server than no thing update.

        Like

        Comment by Chirag — February 3, 2017 @ 1:50 PM

      • Please see how restores works. make sure you do necessary modifications before using the script.

        Like

        Comment by Syed Jahanzaib / Pinochio~:) — February 3, 2017 @ 2:05 PM

  53. Which changes is require in this Script ?

    Like

    Comment by Chirag — February 3, 2017 @ 2:21 PM

  54. on radius manager DMA, showing current ip 0.0.0.0, please can u help me

    Like

    Comment by Naeem — March 15, 2017 @ 7:45 PM

    • any person who tell me what is problem, in DMA radius manager showing active user but current ip address showing 0.0.0.0

      Like

      Comment by Naeem — March 15, 2017 @ 7:47 PM

  55. Dear zaib bro please send me as well the script : adilmunsif40@gmail.com

    Like

    Comment by Adil — November 11, 2017 @ 5:05 PM

  56. Please, do you know how to import users using csv, or in batches rather than registering users one after the other. I have like 25,000 user to import? Please help

    Like

    Comment by olatunde — December 13, 2017 @ 9:22 PM

    • Well you have to create customized script that takes username / password from csv and create users in rm_users table along with radcheck tables as well.

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — December 15, 2017 @ 10:35 AM

      • When insering the password, what hashing method or type needs to be used?

        Like

        Comment by Olatunde — December 15, 2017 @ 11:55 AM

      • inserting where? if in mysql table then MD5

        Like

        Comment by Syed Jahanzaib / Pinochio~:) — December 15, 2017 @ 3:36 PM

      • pls can I get a sample script for inserting users in batches in csv to the radius manager tables? tunscolo2002@gmail.com

        Like

        Comment by tunscolo2002@gmail.com — January 1, 2018 @ 7:19 PM

      • this file you mean ?

        On 6 January 2018 at 19:20, Syed Jahanzaib Personal Blog to Share Knowledge ! wrote:

        > tunscolo2002@gmail.com commented: “pls can I get a sample script for > inserting users in batches in csv to the radius manager tables? > tunscolo2002@gmail.com” >

        Like

        Comment by Abdo Ghor — January 6, 2018 @ 11:33 PM

      • yes, this file.. That will enable radius manager admin to insert users in batches, using csv. God bless you as you help.

        Like

        Comment by tunscolo — January 8, 2018 @ 5:35 PM

  57. Alsalam Alikum …. thank you nice Job … where i can found the backup script to the USB drive and on the backup folder on root . thank you

    Like

    Comment by Abdo Ghor — December 15, 2017 @ 2:38 AM

  58. Alsalam Alukoom
    ============
    i’m going with backup script …
    step by step … i think 70% Okay applied …
    but not sure yet if the backup copied to USB and sent to my Gmail
    ===== when im test backup by line====
    /temp/fullbackup.sh
    have this
    ======================
    ======================
    Checking if USB Is mounted or not…
    USB is not mounted !!
    Mounting USB now…
    mount: mount point /usb does not exist
    /temp/fullbackup.sh: line 35: with: command not found
    Welcome ! This is Radius Manager Backup Script, It will take backup of RADIUS

    Database and FoldersFollowing …
    /var/www/html /sql_backup
    Backup started at 2017-Dec-15 Time 15:14:36 . . .

    Powered by Syed.Jahanzaib

    ********* /backup folder is already present , so no need to create it,

    Proceeding further . . .

    ********* sql_backup folder is already present , so no need to create it,

    Proceeding further . . .

    ********* Exporting MYSQL DUMP to sql_backup …

    ********* TAR – Compressing all Backup Folders to …

    cp: cannot stat `/backup/15.12.2017__time_15.14.__radius_backup.tgz’: No such file or directory
    /temp/fullbackup.sh: line 131: syntax error near unexpected token `)’
    /temp/fullbackup.sh: line 131: `available in single file : )’
    root@abdo:~#
    =====================
    =====================
    any edit 🙂
    thank you

    Like

    Comment by Abdo Ghor — December 15, 2017 @ 6:23 PM

  59. السلام عليكم و رحمة الله و بركاته
    —-
    Mr Syed :
    # is this error about the USB store ? if yes it not compatible ?
    # about the e-mail configurations it complete but till now can’t found e-mail in my box
    thank you

    Like

    Comment by Abdo Ghor — December 18, 2017 @ 4:35 PM

    • just edit the script where is
      TARGET=”/var/www/html /sql_backup”
      with
      TARGET=”/var/www /sql_backup”
      and will be fine

      Liked by 1 person

      Comment by alket — December 24, 2017 @ 4:05 AM

  60. thank you for reply
    still have one error :
    ===========
    /temp/fullbackup.sh: line 149: syntax error near unexpected token `)’
    /temp/fullbackup.sh: line 149: `all data available in single file : )’
    ==========
    how can we fix it .
    thank you

    Like

    Comment by Abdo Ghor — December 29, 2017 @ 4:50 PM

  61. السلام عليكم و رحمة الله و بركاته
    Al Salam Aliukom wa eahmat ALLAH wa barakatoh

    in firstly .. want to thank you for 🙂 this nice script and for all your doing helping us
    ==
    as you seen in this photo the script working well with some errors in lines 219 , 239 ….
    i edited this lines by add # in first each line …

    ====
    than as you see in this photo too
    no errors
    but the backup zipped file take size 17 MB before was 26 MB ..
    and in both i have not backup file in my e-mail inbox
    ===
    how you can help me brothers ?
    thank you

    Like

    Comment by Abdo Ghor — January 1, 2018 @ 4:07 AM

  62. Al Salam Aliukom wa eahmat ALLAH wa barakatoh

    in firstly .. want to thank you for 🙂 this nice script and for all your doing helping us
    ==
    as you seen in this photo the script working well with some errors in lines 219 , 239 ….
    i edited this lines by add # in first each line …


    ====
    than as you see in this photo too
    no errors
    but the backup zipped file take size 17 MB before was 26 MB ..
    and in both i have not backup file in my e-mail inbox
    ===

    how you can help me brothers ?
    thank you

    Like

    Comment by Abdo Ghor — January 1, 2018 @ 4:10 AM

  63. Hello brother, can you send this script to my mailbox: tunscolo2002@gmail.com

    Liked by 1 person

    Comment by tunscolo — January 10, 2018 @ 3:20 AM

  64. Can you also help me on how to import huge users from csv file to radius manager, how to insert them into rm_users and radcheck tables, and other tables if there is? God bless you as you do.

    Like

    Comment by tunscolo — January 10, 2018 @ 3:22 AM

    • its easy. make an bash script that read data (like username and password) from the csv or txt file, then run a loop and add those id/pass in the radcheck and user table. radius manager have many other fields as well so you may want to tweak it like expiration date etc etc

      Like

      Comment by Syed Jahanzaib / Pinochio~:) — January 10, 2018 @ 12:52 PM

  65. Email is tunscolo2002@gmail.com

    Like

    Comment by tunscolo — January 10, 2018 @ 3:23 AM


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: