what is a cron job [closed] - cron

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I see this every time I ask questions about backing up sql through php, but I don't know what is it, or how to install it, or how to use it in my computer(windows xp) to backup mysql database.

Cron is a UNIX utility for running commands at specific times. A cron job is a such a commend when cron has been configured to run it.
On Windows you would likely use the Scheduler instead.

A cronjob is a unix term for a system process (cron) that allows you to schedule tasks to run at a later date under a specified set of privileges.
On Windows, I suggest you create a batch file for your backup, and use the Task Scheduler to run it at the desired time.

cronjobs are available on Linux/Unix machines. These are scripts which you schedule to run at specific times (daily, hourly, monthly).
They are controlled by the unix command "crontab"
To list all of your cronjobs use crontab -l. To edit the list of cronjobs use crontab -e

Related

Monitoring multiple servers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I am required to run a couple of batch scripts at frequent intervals on multiple servers. This requires me to log in to each server every time.Is there an easier way to do this?
Thanks in advance.
Use a screen manager such as screen or tmux to keep the sessions alive if you need an interactive session to do your monitoring.
If you just need to poll for data, ssh allows you to pass a command like this
ssh username#hostname 'command'
You can stick this into a bash script and use cron to run it regularly.
Install a cron job at these servers. Then, it depends on the servers and infrastructure how you can access the output, if you need it.

Command Logs Ubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there anyway that i can log all the commands that a certain user or user group has run in an ubuntu CLI.
I need to keep a track of all the commands run by a certain group of users say
UsrGrp1:usr1,usr2,usr3
as i'm running a Cluster of machines and all are being controlled by different users. And i need to monitor those through the root user of every machine.
The history command gives me all the command logs. But it can be modified by the user itself. So i need to keep the logs under the root user only.
You can try logkeys a keylogger for linux. Another options could be script but with this you need to write a trigger to start it at each user login.

Install script needs to set up a program to run on login in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I need to write an install script that runs an executable/script on login (not startup) in Linux. This needs to work for all current users who can log into the system and users created in the future as well. Is there a way to do this?
In windows this can be achieved by putting a shortcut in the startup folder for "All Users". Is there a similar location/init script in Linux? If not, are there any alternatives?
Thanks in Advance!
The users ~/.bash_profile or ~/.profile depending on shell is executed at login. You can add to that. If you want it for every user, you could put it in /etc/profile.

What is a proper way of switching the servers and VMs off and on for power outage? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
my organisation have two physical servers and some VMs. Currently when there is a pre-scheduled power outage, I use a script I wrote to loop through all VMs scheduling a shutdown command to all VMs and the servers. For example,
ssh root#${VMS[$i]} 'echo "shutdown -h now" | at 05:00am Mar 31'
Then I restart the machines when I am back to the office in the morning.
Is this the appropriate way of doing the auto shutdown? Do you do it differently? Thanks in advanced.
For starters, the shutdown command can take a time directly itself, you don't need to use at for that (see http://www.computerhope.com/unix/ushutdow.htm).
Beyond that, though, I don't see anything wrong with this approach, provided that your environment can tolerate those servers being offline potentially longer than necessary (i.e. if a power outage lasts from 9-10 pm, but you don't start them back up until 8 am the next morning, that's 10 hours longer that they were off than they really needed to be), which your description seems to suggest is the case. In this environment, I don't think I would do anything differently, beyond also scheduling the host computer to shutdown a couple of minutes after the VMs are scheduled to do so.

Linux "top": how to tell which process is what? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have several cron jobs (calling my PHP scripts via curl) in the background that are running. I'm trying to monitor their performance. Using top, I see a bunch of httpd commands -- but I have a feeling these do not represent the cron jobs (e.g. too many httpd exit for the cron tasks being called).
How can I know what the httpd processes are for sure? Are there any other tools I should be looking at to monitor my system?
What you want is to look in /proc/[pid]/status.
You can get a hierarchically overview about your running processes with ps efaux or pstree -A -p
Maybe that helps.

Resources