Tutorial - Backup Oscam/cccam configs every day at midnight on your Linux Server

There are 18 replies in this Thread which was already clicked 4,204 times. The last Post () by codar.

  • Automated Backup Script for Oscam/CCcam configs


    Here is a handy script to backup all your CS Server configs every night..
    oscam-backup.rar




    Step 1: prepare for the script


    Create a folder in /var called "oscam-configs-backup"

    Code
    cd /var/
    mkdir oscam-configs-backup




    Step 2: Move Script to Server & Chmod it


    FTP the script to /var/script
    Chmod the script

    Code
    chmod 755 /var/script/oscam-backup.sh




    Step 3: Edit the script to suit your needs & Backup tye correct folders



    The folders & Files in Red are the files I backup for my server, you might want to add Files & Folders for your setup.
    This is the only line in the script than might need editing
    For example, If you wanted to add CCcam files to the backup, just add "/var/etc/*CCcam*" to the script. So the line would look like this:
    backup_files="/var/script /usr/local/etc /var/etc/*CCcam* /etc/crontab /etc/rc.local"



    Step 4: Auto run the Script from crontab


    Just add this line to /etc/crontab

    Code
    59 23   * * *   root    /var/script/oscam-backup.sh


    Thats it, If you want to test the script, just run it with this command:

    Code
    /var/script/oscam-backup.sh


    Then test the Archive it creates at /var/oscam-configs-backup


    Every few weeks I move all the backups to my local PC to keep safe.
    These backups have come to my rescue many times..




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • Hello,
    I have tried your tuto,its not working with me under ubuntu server
    ./var/script/oscam-backup.sh
    -bash: ./var/script/oscam-backup.sh: Aucun fichier ou dossier de ce type
    /var/script/oscam-backup.sh
    -bash: /var/script/oscam-backup.sh : /bin/sh^M : mauvais interpréteur: Aucun fichier ou dossier de ce type
    :/var/script# ls
    CCcamCheck.sh keyupdater.sh oscam-backup.sh
    /var# ls
    backup cccaminfo_users etc local opt spool
    backups cccamlog games lock oscam-configs-backup

  • Pretty self explanatory m8
    "No file or folder of this type"


    Can you post your edited script




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • Pretty self explanatory m8
    "No file or folder of this type"


    Can you post your edited script


    here is the script placed in /var/script under ubuntu 12.04


    My configs files its in /usr/local/etc :)

  • here is the script placed in /var/script under ubuntu 12.04


    My configs files its in /usr/local/etc :)


    Can someone help me please?:trbtjrjq:

  • Did you chmod 755 the script??


    Its a very basic script that should work on any linux system..
    In fact I use ubuntu 12.04 myself..


    Have you setup root account on your server?


    you could also try:

    Code
    cd /var/script/


    Code
    ./oscam-backup.sh



    Please post any errors in English only m8...




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • yes i have chmod 755 the script,i'm connected under root access..

  • The only thing I can think of m8 is that you edited the file in windows notepad or similar and removed linux formatting..
    copy the orig script to your server, chmod 755 it & run it to test. Do not make any edits!




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • Hello, first of all thanks for your work, I wanted to ask if in that script you can insert a function to send the created backup to an email, it would be very useful, thanks and greetings

  • Quote

    I wanted to ask if in that script you can insert a function to send the created backup to an email, it would be very useful,


    Yes, it most certainly can be done but I do not have the know-how or the time to figure it out at the minute..
    Why dont you make that your pet linux project m8 & report back with the solution!




    All your problems have been solved countless times before so try the search box before you post!!
    Please do not Request help by PM, use the main forum so Everyone can benefit from the answers.

  • im using ubuntu 16.4 and i cannot find the folder script in var/script to put the "script" in


    is it somewere else in this version of ubuntu



    Step 2: Move Script to Server & Chmod it


    FTP the script to /var/script
    Chmod the script
    Code:


    chmod 755 /var/script/oscam-backup.sh

  • master G

    Added the Label Article

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!