Jump to Navigation

script

236 - SFTP public key authentication

You have few options other than using public key authentication:

    Use keychain
    Use sshpass (less secured but probably that meets your requirement)
    Use expect (least secured and more coding needed)

This is a sample on sshpass.

Need to download the package and install it into the linux box :
RedHat does not provide this package from RHN.

http://rpm.pbone.net/index.php3/stat/45/idpl/17273067/numer/1/nazwa/sshpass

Linux:

209 - Bash [: too many arguments

If you run the following script, you got an error sometimes.

if [ -e /tmp/* ]; then
   echo "files exist"
else
   echo "No file exists"
fi

This is using -e (existing a file check) that is working fine on individual files. This code works fine if the result is one file;
but if you have more files returned,  it fails with the following error:

line x: [: too many arguments

Linux:

031 - Using SQL*Plus on Linux

To run SQL*Plus, or any Oracle-supplied command, you must have several environment variables set.
You can set these environment variables automatically at login by editing your login script, or
you can use an environment variable script built, When you installed Oracle Database XE, the installer
creates two scripts that define the environment variables for you.

Environment Variable Script(Bourne, Korn, Bash):
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

Oracle:
Linux:

021 - MySQL Backup Script Sample1

This is a sample backup script to keep the mysql dump for 3 days.

Example:

#!/bin/bash

# Set parameters for MySQL
DBNAME=database_name
#HOST=host_name
USER=user_name
PASSWORD=password

# Set parameters for the backup path
ROOT_PATH=/var/www/vhosts/your domain/data
BKUP_PATH=/var/www/vhosts/your domain/backups

MySQL:
Linux:
Subscribe to RSS - script


Main menu 2

by Dr. Radut