Solved

Locating a cron job in Centos and editing an existing mount.

Posted on 2010-09-02
12
580 Views
Last Modified: 2013-12-16
Hi,

I am trying to find out where a daily mysqldump file gets executed on a Centos box as it needs editing.

The original person who set this job up has left the company along with any information about this Centos box.

I have attached a screenshot of the cronlog job running but I just cannot find out where it is running.
I've looked in the /etc/cron.d, cron.daily files but can't see any evidence of it.

I will also probably need to change the mnt to the server called blackpool as we have moved to a new domain with different username and password credentials so any help with changing this as well would be great.

Thanks!
centos-log.jpg
0
Comment
Question by:Vai777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
12 Comments
 
LVL 20

Expert Comment

by:woolnoir
ID: 33585052
It looks like it runs as root, my first port of call would be doing a crontab -l as root ? i'm assuming you have tried this ?
0
 
LVL 9

Expert Comment

by:oheil
ID: 33585110
Look into:
/var/spool/cron/
if there are any other users who run cron jobs using crontab.
Other sources are
/etc/cron.d/
/etc/cron.daily/
and os on or
/var/spool/cron/atjobs/
/var/spool/cron/atspool/

Or do a time consuming:
find / -type f -exec grep "mysqldump" /dev/null {} \;
or more specific
find / -type f -exec grep "mysqldump" /dev/null {} \; | grep blackpool

Regards,

Oli
0
 
LVL 9

Expert Comment

by:oheil
ID: 33585119
Maybe these are weekly jobs because they are specific for week day. Have a look in

/etc/cron.weekly/

Regards,

Oli
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Vai777
ID: 33585124
Ah ha!
No I hadn't done this. I'm not very familiar with the command line on Linux. I've just been trying to browse around the filesystem looking for the cron job.

After doing the crontab -l command I can see the entries for the job. How can I edit this? And can you explain the command that is executed a bit? The first part mainly. I get the idea on the latter part. Is the job called mysqldump?
Also I think the mount to blackpool will need setting up again.
0
 
LVL 20

Accepted Solution

by:
woolnoir earned 500 total points
ID: 33585130
run a crontab -e from the root account to load an editor and edit the job. Once complete, save the file and it will submit it.
0
 

Author Comment

by:Vai777
ID: 33585235
What is the lollipop password for? Is it the mount? How do I save any changes and exit the editor?

Sorry to sound like a newbie but I'm a Linux novice tbh.
0
 
LVL 20

Assisted Solution

by:woolnoir
woolnoir earned 500 total points
ID: 33585321
the password is for the mysql user which is being used for the DB dump.
The editor for the crontab is likely to be VI and to save you need to run a ':wq' command, that will write an quit. Just type the : then 'wq' and press enter.
0
 

Author Comment

by:Vai777
ID: 33585412
Thanks woolnoir.
How can I tell if the /mnt/blackpool.... is working correctly? What credentials is it using to mount this location?
0
 
LVL 20

Assisted Solution

by:woolnoir
woolnoir earned 500 total points
ID: 33585425
cd into the /mnt/blackpool folder as root, can you see any files ?
the mounting of the folder should be controlled from the /etc/fstab file, the format of this can be looked at here

http://www.tuxfiles.org/linuxhelp/fstab.html

or it may be a network mounted folder (i think it is) in which case it gets a bit more complicated. Let me see your fstab file to start with.
0
 

Author Comment

by:Vai777
ID: 33585487
I've just looked in the /etc/fstab file and can see the mount and the user credentials so I can edit this and set this up with the new credentials.

I'm using vi to edit the file.

Your help with this has been great. Thanks woolnoir. I've learnt something today. :-)
0
 
LVL 20

Expert Comment

by:woolnoir
ID: 33585524
Thats what Experts-Exchange is all about :) Were all here to learn.
0
 

Author Closing Comment

by:Vai777
ID: 33585560
A great help. I managed to get my head around how it was all setup.
I can now document this for future reference either by myself or colleagues.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question