Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. Veritas NetBackup™ for Sybase Administrator's Guide
  3. Configuring NetBackup for Sybase
  4. About the backup, restore, and load scripts for NetBackup for Sybase on UNIX
  5. Example sybase_mydb_backup.cmd script for NetBackup
Veritas NetBackup™ for Sybase Administrator's Guide

Example sybase_mydb_backup.cmd script for NetBackup

The following code example shows the sybase_mydb_backup script:

#***************************************************************************
# Replace /usr/sybase12 below with the actual Sybase home directory 
#***************************************************************************
SYBASE=/usr/sybase12
  
#***************************************************************************
# Replace SYBASE12 below with the actual name of the SQL Server
#***************************************************************************
SYBSERVER=SYBASE12
  
#***************************************************************************
# Replace SYB_DB below with the actual name of your Sybase database
#***************************************************************************
DATABASE_NAME=SYB_DB
  
#***************************************************************************
# Replace syb_files below with your actual name of the NetBackup 
# server Policy to be used to backup the directory with Sybase script files
#***************************************************************************
SYB_FILES_POLICY=syb_files
  
#***************************************************************************
# Replace /usr/sybase12/scripts below with your actual path of the Sybase files 
#***************************************************************************
SYB_FILES_DIR=/usr/sybase12/scripts
  
if [ ! -d "${SYBASE}"/ASE-12_0/ ]
then
#************** Sybase 11.9.2 or earlier *******************
ASE_QUAL=
OCS_QUAL=
else
#************** Sybase 12.0 ****************************
SYBASE_ASE=ASE-12_0; export SYBASE_ASE
SYBASE_OCS=OCS-12_0; export SYBASE_OCS
ASE_QUAL=/$SYBASE_ASE
OCS_QUAL=/$SYBASE_OCS
fi
  
  
echo "Started 'date'"
SYBASE=$SYBASE; export SYBASE
# These environment variables are set by NetBackup 
echo "SYBACKUP_SERVER = $SYBACKUP_SERVER"
echo "SYBACKUP_POLICY = $SYBACKUP_POLICY"
echo "SYBACKUP_SCHED = $SYBACKUP_SCHED"
echo "SYBACKUP_SCHEDULED = $SYBACKUP_SCHEDULED"
echo "SYBACKUP_USER_INITIATED = $SYBACKUP_USER_INITIATED"
  
RETURN_STATUS=0
  
#***************************************************************************
# Replace "database_dump" below with your actual NetBackup schedule name
# which is used for a full backup of the Sybase database.
#***************************************************************************
if [ "${SYBACKUP_SCHED}" = "database_dump" ]
then
############# NetBackup has started a "database_dump" backup ##############
DUMP_TYPE=DATABASE
  
else
############# NetBackup has started a "transaction log" backup ##############
DUMP_TYPE=TRANSACTION
fi
  
#***************************************************************************
# Replace "Default-Application-Backup" below with your actual NetBackup 
# Application Backup type schedule name for the Sybase database. 
#***************************************************************************
    echo dump $DUMP_TYPE $DATABASE_NAME to \"sybackup::-SERV $SYBACKUP_SERVER -POL 
$SYBACKUP_POLICY -SCHED Default-Application-Backup\" > ./syb_${DATABASE_NAME}_dump
  
#**************************************************************************
# Remove the '#' from the beginning of the line below if you are going to
# use multiple stripes for the backup. Repeat this line for each stripe.
# Replace "Default-Application-Backup" below with your actual NetBackup
# Application Backup type schedule name for the Sybase database.
# **************************************************************************
# echo stripe on \"sybackup::-SERV $SYBACKUP_SERVER -POL $SYBACKUP_POLICY 
-SCHED Default-Application-Backup\" >> ./syb_${DATABASE_NAME}_dump 
  
echo go >> ./syb_${DATABASE_NAME}_dump
  
#***************************************************************************
# Replace "manager" with your Sybase server Administrator's Password
#***************************************************************************
    echo "$SYBASE$OCS_QUAL/bin/isql -Usa -Pmanager -I$SYBASE/interfaces -S$SYBSERVER 
< ./syb_${DATABASE_NAME}_dump"
  
    $SYBASE$OCS_QUAL/bin/isql -Usa -Pmanager -I$SYBASE/interfaces -S$SYBSERVER 
< ./syb_${DATABASE_NAME}_dump
    RETURN_STATUS=$?
  
if [ "${DUMP_TYPE}" = "DATABASE" ]
then
#  Initiate a backup of any file related to the Sybase database, such as script files.
  
    echo "bpbackup -c $SYB_FILES_POLICY $SYB_FILES_DIR"
    /usr/openv/netbackup/bin/bpbackup -c $SYB_FILES_POLICY $SYB_FILES_DIR
    BPBACKUP_STATUS=$?
  
    if [ "$BPBACKUP_STATUS" -ne 0 ]
    then
        echo ""
        echo "bpbackup of $SYB_FILES_DIR returned $BPBACKUP_STATUS"
    fi
fi
  
  
echo "Finished 'date'"
  
echo "exit $RETURN_STATUS"
echo ""
  
exit $RETURN_STATUS

More Information

NetBackup for Sybase configuration or bp.conf file settings

Feedback

Was this page helpful?
Previous

Modifying the backup script for NetBackup for Sybase on UNIX

Next

Modifying the restore script for NetBackup for Sybase on UNIX

Feedback

Was this page helpful?