I am running this script on Mandrakelinux release 10.1, 2.6.8.1-12mdksmp #1 SMP
I have also installed 'expect' separately.
I have created an Rsync script, but before any Rsync command does run, a MySql dump must be done first, and I am battling a bit to pass the MySql password from the bash script.
This is what my script looks like:
The output I get when running the script is:
Quote:
expect: invalid option -- u
usage: expect [-div] [-c cmds] [[-f] cmdfile] [args]
===============
spawn /usr/local/mysql/bin/mysqldump
rsync: link_stat "/Data/Mysql_Backups/backup.sql" failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at main.c(692)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)
Hi,
Anybody help to write a shell script as below requirement.
script stops some costomized application services.
1. first it will stop apache as root
2. then it will switch to my application user and stop app service.
Note: passing password is required to stop app service as app... (1 Reply)
I have a requirement, I need to run a command at remote system using a ssh. Is there any way we can pass the username and password in shell script to the ssh command as we did it in one of the shell script for FTP.
ftp -n $i <<!EOF >>
user Username $PASSWD
cd /home/scripts
... (5 Replies)
I heard this was possible but from my research I haven't been able to figure it out yet. Seems it should be simple enough. Basically from a high level view I'm trying to accomplish...
. $X='grep foo blah.log'
then 'mysql command SELECT foo FROM bar WHERE ' . $X
or something like that.
... (2 Replies)
Hi,
I need to connect to DB through my shell script. but I dont want to hardcode my db password in the script. Is there a way to do it?
Thanks
---------- Post updated at 07:42 PM ---------- Previous update was at 04:54 PM ----------
:(Guys..please help me with this:( (1 Reply)
Used the script posted on forum - unix.com/shell-programming-scripting/21597-script-change-passwords-same-user-multiple-servers.html but the last question posted on this seems to be still unanswered, tried different things with no success, can someone help giving an way to pass the password via... (5 Replies)
How can I pass password in SSH command without using expect in a shell program.
I don't have expect installed on my Solaris server.
#!/bin/bash
ssh user@hotname (how to supply pass in script?:wall:)
Experts please help its very urgent.
Shrawan Kumar Sahu (4 Replies)
I want to do following 2 commands via script:
1) eval `ssh-agent`2) ssh-add /export/home/sufuser/.ssh/id_rsa When asked for passphrase enter "passwordpassword1234
but whenever I run the script it stucks after "ssh-add /export/home/sufuser/.ssh/id_rsa" command and asks fro... (4 Replies)
I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored.
The code:
read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
Newbie here. My goal is to have the expect script log into the Ubuntu 18.04 server and run two commands (lsb_release -a and ip addr) and eventually pipe the output/results to a file. For now, I would be happy to get this one command or two to run successfully. How to fix this?
#!/usr/bin/expect ... (3 Replies)
Discussion started by: jacob600
3 Replies
LEARN ABOUT DEBIAN
automysqlbackup
automysqlbackup(8) Automatically backup MySQL automysqlbackup(8)NAME
automysqlbackup - backup all of your database daily, weekly, and monthly
SYNOPSIS
automysqlbackup
DESCRIPTION
This manual page documents briefly the automysqlbackup command.
configuration is stored within the /etc/default/automysqlbackup file
PARAMETERS
USERNAME=dbuser
Username to access the MySQL server e.g. dbuser
PASSWORD="password"
Username to access the MySQL server e.g. password
DBHOST=localhost
Host name (or IP address) of MySQL server e.g localhost
DBNAMES="DB1 DB2 DB3"
List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
BACKUPDIR="/backups"
Backup directory location e.g /backups
MAILCONTENT="stdout"
Mail setup What would you like to be mailed to you?
- log : send only log file
- files : send log file and sql files as attachments (see docs)
- stdout : will simply output the log to the screen if run manually.
- quiet : Only send logs if an error occurs to the MAILADDR.
MAXATTSIZE="4000"
Set the maximum allowed email size in k. (4000 = approx 5MB email [see docs])
MAILADDR="user@domain.com"
Email Address to send mail to? (user@domain.com)
ADVANCED OPTIONS
MDBNAMES="mysql $DBNAMES"
List of DBBNAMES for Monthly Backups.
DBEXCLUDE=""
List of DBNAMES to EXCLUDE if DBNAMES are set to all (must be in " quotes)
CREATE_DATABASE=yes
Include CREATE DATABASE in backup?
SEPDIR=yes
Separate backup directory and file for each DB? (yes or no)
DOWEEKLY=6
Which day do you want weekly backups at? (1 to 7 where 1 is Monday)
COMP=gzip
Choose Compression type. (gzip or bzip2)
COMMCOMP=no
Compress communications between backup server and MySQL server?
LATEST=no
Additionally keep a copy of the most recent backup in a separate directory.
MAX_ALLOWED_PACKET=
The maximum size of the buffer for client/server communication. e.g. 16MB (maximum i
SOCKET=
For connections to localhost. Sometimes the Unix socket file must be specified.
#PREBACKUP="/etc/automysqlbackup/mysql-backup-pre"
Command to run before backups (uncomment to use)
#POSTBACKUP="/etc/automysqlbackup/mysql-backup-post"
Command run after backups (uncomment to use)
AUTHOR
This manual page was written by Jose Luis Tallon <jltallon@adv-solutions.net>. for the Debian GNU/Linux system, but can be used by others.
wipe_out 6 Sep 2008 automysqlbackup(8)