General :: Script To Mail Output Of Mysql Queries?
Mar 15, 2011
I have prepared a simple script that shows the database, tables size in the Database server as :-
check the attachment for the script & output.
Now I just want to mail the output of my script to some persons e-mail-ID
Also, I want to do some calculations and provide the information of how much increase data after 1 day daily.
View 2 Replies
ADVERTISEMENT
Feb 15, 2011
I have a daily routine task of checking the size of mysql tables in a database in Mysql Database Server.
I want to achieve this task through a bash script that runs daily and calculate the size of mysql tables and finally mail it to DBA email-id fore.g adarsh.sharma@orkash.com
I try a simple script to mail but it fails .
#!/bin/bash
SUBJECT="Automated Security Alert"
TO="adarsh.sharma@orkash.com"
MESSAGE="/tmp/message.txt"
echo "Security breached!" >> $MESSAGE
echo "Time: `date`" >> $MESSAGE
/bin/mail -s "$SUBJECT" "$TO"
It hangs when I run bash a.sh command. However it creates file in /tmp folder and have all contents.
View 1 Replies
View Related
Jun 5, 2011
i'm not sure if this is because i'm having problems with my Raid setup, which mysql is running on, or if it is unrelated, but is anyone else noticing that mysql is VERY slow on Fedora 15?
View 5 Replies
View Related
Mar 29, 2011
I'm trying to make a script in my /etc/cron.d directory called df. Anyways, I want to be able to have it run the df command every hour, 23 minutes past the hour. I have the first part, I just need assistance in directing it to roots mail box.
View 2 Replies
View Related
Mar 30, 2011
I have a script that uses cp to copy data from A to B. There are some troublesome files that are constantly in use and read "Permission denied" or "Text file busy" but I'm not worried about these. Therefore my copy process always contains output.The script runs through cron and the output (automatically) goes to /var/mail/user. I tried setting it up to send me an email and it comes through, but it's completely blank. The email in /var/mail/ contains the full output.
Here is my command:
0 18 * * * /home/backup.sh | mail -s "Backup completed" jsteel@...com
(The script simply contains many "cp -r /mnt/location/a /mnt/location/b")
[code]....
View 2 Replies
View Related
Mar 4, 2010
How can i make a script to send the output of top command in mail.
i have to mail the output to another person , tell me how can i do this
View 3 Replies
View Related
Jun 2, 2010
i am using liferay5.2(mysql included in the download pack) on fedora. while liferay is working fine but i cannot connect to mysql.i am getting the error
[
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
[code]....
i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock. i cannot find the portal-ext.properties file also to make intial settings.
View 9 Replies
View Related
Mar 6, 2010
i want to know about the partition size of linux in my system..i have pentium 4 with 512 mb ram and 15 gb hard disk for opensuse 11.1..i want to know how much space should be allocated for /,/home ,swap etc and under what kind of partition they should be formatted (like primary,logical,extended etc)...kindly help me in this regards...I have windows xp and want to install opensuse with it.
View 2 Replies
View Related
Jan 9, 2009
Is there a way to run queries against a Microsoft sql server from linux? Here is what I would like to do. When I create apps that us db back end I would like to quickly check results of my queries. so if I could do something like "select * form Orders" from the terminal or another app that would be great.
View 6 Replies
View Related
Mar 17, 2010
1. What difference will it make if I set the mount point to "/" instead of "/boot" and vice-versa ?
2. I heard somewhere that the data on a primary partition can be easily recovered in case of some failure.
If it is so then what out of the following should IDEALLY be created as primary partition ?
/usr
/home
/boot
I think /usr and /home both need a primary partition , then what about /boot, Will I be not able to recover something in case of failure if I don't set /boot as a primary partition ?
View 5 Replies
View Related
Sep 11, 2010
I currently have 2 operating systems on my main hdd: Ubuntu and WinXP My current setup - [storage NTFS partition, solely data][17GB WinXP partition][{extended partion}Ubuntu + swap]: [URL] I have a second SATA hdd that I would like to install Arch Linux on to. It uses GRUB Legacy, and Ubuntu uses GRUB 2. I would like to know how I would go about booting this, and figure out where my current bootloader is installed to. i.e. /dev/sda or /dev/sda5 (the / ubuntu partiton)
View 3 Replies
View Related
Jun 9, 2010
I have machine which manages all mail accounts and their traffic and as well mysql database and some more stuff. Theres also windows server where users are managed and they get their programs from over rdp. I have login screen on Linux machine. It says Debian GNU/Linux 5.0. And I have root password, but I know that I have to login first with simple user account after which I can access login as root. But where can I get simple user account info. I need to manage mailaccounts mainly there.
View 3 Replies
View Related
Jul 27, 2010
i will be quick, im trying to send a mysql query output into an array ie:
Code:
declare -a HD
HD=`echo "USE db; SELECT uid FROM user" | mysql -u $login -p$pwd -h $dbhost -B`
echo ${#HD}
those vars in mysql connection are previously and correctly assigned.
but got an error
script.sh: 2: declare: not found
View 3 Replies
View Related
Feb 22, 2011
So I've got a rather vast database, one of the columns is date in the following format: DD/MM/YY HH:MM:SS. This is starting to cause problems with a php page I'm writing which asks the user for a 'start date'. Would it be better for me to split the date column into date and say time? Or is there a way of using distinct and masking the times.
View 10 Replies
View Related
Jan 6, 2010
I'm new to mail via the CLI, so bear with me. I have this line in my crontab:
Code:
*/5 * * * * fetchmail
Which does check my mail every 5 minutes fine. But I get the command-line output mailed to
[code]...
View 3 Replies
View Related
Jan 18, 2010
I want to ask how i set Linux class path for mail.jar and mysql-connector.jar. I have set the class path for java with the command.
Code:
when i do java -version it's work fine.
Also if i want to know that what shell i am using how can i find it.Also what is the command for showing class path variables or how can i see my JAVA_HOME class path.Means after setting the class path for above two files how can i see that these files have added.
When i write echo $CLASSPATH or echo $JAVA_HOME it shows nothing no error but again shows the prompt.
One thing more i want to run a java program on Linux it is in a package (named asteriskproject). It consist of 10 java files. I have run this program on windows using netbeans IDE.For this program i need to set my Linux class path for the above mentioned files, and this is my first time that i am running any program on Linux. So i want to ask how can i run my program. Simply put this asteriskproject directory in any folder and run the main file using javac. Is it right way to run the program that consist of package ?
View 3 Replies
View Related
Jan 27, 2011
Can anyone tell me what the pros and cons are between heirloom-mailx vs mailutils? This is for ubuntu 10.04 LTS. AT this point my only purpose is to use the mail command line program to occasionally send log output to email aliases.
View 2 Replies
View Related
Aug 7, 2010
How do I create a new mysql user and a mysql database at the shell prompt?
View 1 Replies
View Related
Feb 19, 2010
Mysql starting problem after changing mysqladmin password.I tried all the solutions available on forums, but not solve the problem.At last I restored the mysql db backup, this make mysql service start, but till other databases not showing all tables.
View 1 Replies
View Related
May 13, 2011
I have install mysql on my fedora12. My different mysql server is located in us. I want to check health status and hits per seconds everything. Is it possible with mysql-administrator command.
now a these days i am connect through ssh and excuting below command
#mytop mysql -u root -p <passwd>
In my mysql db i have added the userip & passwd (allowed the privileages for that ip)
If i use mysql-administrator i am getting below error
MySQL Error Nr. 2003
Can't connect to MySQL server on '66.98.152.64' (111)
View 6 Replies
View Related
Jun 14, 2011
I have tried many different ways to interact with the mysql to reset the root mysql pass. This is what I got to right now
Code:
#!/bin/sh
newpass=$1
service mysqld stop
mysqld_safe --skip-grant-tables --skip-networking &
echo "use mysql;" >> /tmp/mysql_pass_reset.txt
echo "update user set password=PASSWORD("$newpass") where User="root";" >> /tmp/mysql_pass_reset.txt
[Code]...
View 6 Replies
View Related
Jul 20, 2011
I have got a nagios server running on my network, The configuration seems to be okay but each time there is a service alert notification, and an e-mail is sent to the contact group, Nagios continuously sends e-mail over and over again. Do anyone know of a way to set Nagios directives to only send one e-mail per alert without it flooding mail boxes.
View 3 Replies
View Related
Nov 15, 2010
I had configured sendmail on linux 5.2, Iam using public ip and my domain is registered[linuxforfreshers.info]. I am facing a issue that when I mail with the user sumit@linuxforfreshers.info then I am able to do it. But if somebody tries to send mail to the same user then it bounce backs. I had made the entry of domain in /etc/mail/local-host-name and also I put ok in /etc/mail/access.The mails are working properly with in LAN. But not able to work on WAN only I can send mail but not able to recieve mail.What else I need to do.
View 6 Replies
View Related
Jan 9, 2011
I am trying to configure mutt to send email via command line . It works fine when I configure it for gmail as follows:Quote:
# SENDING MAIL
set copy=yes
set smtp_url = "smtp://mymail@smtp.gmail.com:587/"
[code]...
View 14 Replies
View Related
Jun 8, 2011
How to configure a Debian mail server as a user send a mail with attachment maximum wight is 5 Mb.
View 3 Replies
View Related
Oct 30, 2010
How can I split my local mail box into an individual files for each mail. The senario of mine is I fetch some emails from a mail server into my local linux box with fetchmail command but I want each fetched mail in a different indivitual file for easy file processing and manipulation for example sending those email through sms and so on
View 1 Replies
View Related
Aug 7, 2011
I need help in setting up the native e-mail client included in Debian Squeeze. My ultimate goal is to have the Debian e-mail client download e-mail messages and process attachments automatically.
View 14 Replies
View Related
Jun 7, 2011
I think this goes here, but I'm not sure. I decided that XAMPP had been troublesome enough. MySQL never worked. So I decided to instal the LAMP stack offered by YaST. I went about installing it thinking that it would all work. But it seems that I was wrong. So I try to start mysql, and here's what I get:
Code:
the-matrix:~ # mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) or
Code:
the-matrix:~ # rcmysql start
Starting service MySQL warning: /var/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory
[Code]...
View 6 Replies
View Related
Mar 10, 2011
I just want to know is it possible to extract a single mail from the mail path i.e. /var/mail/root.
for ex. i am having this mail in /var/mail/root.
From root@localhost.localdomain Thu Mar 10 21:47:47 2011
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id p2AGHlx4004190
for <root@localhost.localdomain>; Thu, 10 Mar 2011 21:47:47 +0530
[Code]....
how to extract only this mail from /var/mail/root
View 2 Replies
View Related
Feb 25, 2011
I have configured fetchmail, sendmail/postfix and mutt to act as a relay to receive mail. I can receive mail fine but I cannot send mail. Its working fine on my one box but on the one acting as a nat I am having issues. This is my mail log from the nat box.
Feb 25 03:42:25 TrunkmonkeyNat sendmail[4382]: p1P8gPfd004382: from=root, size=52, class=0, nrcpts=1, msgid=<201102250842.p1P8gPfd004382@localhost.localdomain>, relay=root@localhost
Feb 25 03:42:25 TrunkmonkeyNat sendmail[4383]: p1P8gPgn004383: from=<root@localhost.localdomain>, size=353, class=0, nrcpts=1, msgid=<201102250842.p1P8gPfd004382@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
[Code]....
View 116 Replies
View Related