Sponsored Content
Full Discussion: Cron job for MySQL process
Top Forums Shell Programming and Scripting Cron job for MySQL process Post 302972557 by Don Cragun on Friday 6th of May 2016 08:38:32 PM
Old 05-06-2016
How long does it take to run your mysql command? How much variation is there in the time it takes to run your mysql command?

If you want to run your command 12 times/minute, don't you want the seconds in output filename? As in:
Code:
mysql -ufoo --password='' -te "show full process list" > /home/foo/log/show_processlist.log.`date +%Y%m%d-%H%M%S` 2>&1

If not, the output from the first 11 times you run it will be overwritten by the last time it runs in that minute?

Or, didi you intend to store the output of running your command 12 times in each file with the output from later runs appended to the file instead of replacing the previous contents? As in:
Code:
mysql -ufoo --password='' -te "show full process list" >> /home/foo/log/show_processlist.log.`date +%Y%m%d-%H%M` 2>&1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies

2. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

3. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

4. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

5. Solaris

Cron Job -- auto start process when it dies

I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message.... can any one help writing a script? thanks (3 Replies)
Discussion started by: chandravadrevu
3 Replies

6. UNIX for Dummies Questions & Answers

cron job is unable to process

Hi All, I have got a shell script that excutes some job and mails me the output as an attachment. While running the script manually, its perfect. when i am scheduling the job through crontab, i am getting the mail. but the attachment but this is a blank file. after the scheduler run, i can... (2 Replies)
Discussion started by: gotam
2 Replies

7. Shell Programming and Scripting

Cron job and shell script to kill a process if memory gets to high

Hello, I'd like to set a cron job that runs a shell script every 30 minutes or so to restart a java based service if the memory gets above 80%. Any advice on how to do this? Thanks in advance! - Ryan (19 Replies)
Discussion started by: prometheon123
19 Replies

8. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

9. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

10. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies
mysqld_multi(1) 						  MySQL database						   mysqld_multi(1)

NAME
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports. USAGE
mysqld_multi [OPTIONS] {start|stop|report} [GNR,GNR,GNR...] SYNOPSIS
mysqld_multi [--config-file=...] [--example] [--help] [--log=...] [--mysqladmin=...] [--mysqld=...] [--no-log] [--password=...] [--tcp-ip] [--user=...] [--version] DESCRIPTION
mysqld_multi --config-file=... Alternative config file. NOTE: This will not affect this program's own options (group [mysqld_multi]), but only groups [mysqld#]. Without this option everything will be searched from the ordinary my.cnf file. --example Give an example of a config file. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended. --mysqladmin=... mysqladmin binary to be used for a server shutdown. --mysqld=... mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just make sure you have mysqld in your environment variable PATH or fix mysqld_safe. --no-log Print to stdout instead of the log file. By default the log file is turned on. --password=... Password for user for mysqladmin. --tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket. --user=... MySQL user for mysqladmin. --version Print the version number and exit. NOTE
Please see the mysql manual for more detailed information on this. SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_safe(1), mysqldump(1), mysql_fix_privilege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
Ver 1.0, distribution 4.0.24 Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercur- media.com) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 19 December 2000 mysqld_multi(1)
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy