Results 1 to 2 of 2

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

  1. #1
    Status
    Online
    Geosharing's Avatar
    GS Administrator
    Join Date
    May 2014
    Location
    -=UAE=-
    Interests
    CardSharing
    Posts
    1,895

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

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

    cd /var/
    mkdir oscam-configs-backup


    Step 2: Move Script to Server & Chmod it

    FTP the script to /var/script

    Chmod the script

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


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


    #!/bin/sh
    ####################################
    # Backup Oscam Configs script.
    # tahtfellow - Linuxsat-Support
    ####################################

    # What to backup. (Add or edit the folders/files below to cover your needs)
    backup_files="/var/script /usr/local/etc /etc/crontab /etc/rc.local"

    # Where to backup to.
    dest="/var/oscam-configs-backup"

    # Create archive filename.
    datetime=$(date +"%Y-%m-%d-%H.%M.%S")
    hostname=$(hostname -s)
    archive_file="$datetime-oscam_configs_backup-$hostname.tgz"

    # Print start status message.
    echo "Backing up $backup_files to $dest/$archive_file"
    date
    echo

    # Backup the files using tar.
    tar czf $dest/$archive_file $backup_files

    # Print end status message.
    echo
    echo "Backup finished"
    date

    # Long listing of files in $dest to check file sizes.
    ls -lh $dest

    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

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

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

    /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.. ''

  2. #2
    Status
    Offline
    carding343's Avatar
    Member
    Join Date
    Aug 2014
    Posts
    74
    thanks Administrator for this good work

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-01-2015, 02:09 PM
  2. Replies: 2
    Last Post: 10-06-2014, 03:35 PM
  3. Replies: 1
    Last Post: 08-10-2014, 04:45 AM
  4. Replies: 1
    Last Post: 08-10-2014, 04:43 AM
  5. Replies: 0
    Last Post: 05-15-2014, 07:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
RSS RSS 2.0 XML MAP HTML TAGS

All posts written express the point of view of its owner, does not imply in any way the point of view of management forum.

petites annonces