Hot answers tagged

60

There are a couple of programs that automate this feature, take away the annoyance and potential bugs from doing this yourself, and avoid the stale lock problem by using flock behind the scenes, too (which is a risk if you're just using touch). I've used lockrun and lckdo in the past, but now there's flock(1) (in newish versions of util-linux) which is ...


23

Best way in shell is to use flock(1) ( flock -x -w 5 99 ## Do your stuff here ) 99>/path/to/my.lock


17

Actually, flock -n may be used instead of lckdo*, so you will be using code from kernel developers. Building on womble's example, you would write something like: * * * * * flock -n /some/lockfile command_to_run_every_minute BTW, looking at the code, all of flock, lockrun, and lckdo do the exact same thing, so it's just a matter of which is most readily ...


14

Assuming you're just setting the task to "Repeat" in the XP "Scheduled Tasks" system, no further action on your part is needed. Scheduled Tasks won't "Repeat" a task if it's already running. If you want to override that default, you can check the box "If the task is still running, stop it at this time" to cause the task scheduler to kill the last instance ...


7

You can use the nproc shell script tool. So it would be -j$(nproc) in the make command line in question.


5

The kernel documentation says it best: Sometimes it happens that a request enters the io scheduler that is contiguous with a request that is already on the queue. Either it fits in the back of that request, or it fits at the front. That is called either a back merge candidate or a front merge candidate. Due to the way files are typically laid out, ...


4

A heavy weight solution to your problem is to use a something like Sun Grid Engine. Sun Grid Engine (SGE). SGE is a distributed resource management software and it allows the resources within the cluster/machine (cpu time,software, licenses etc) to be utilized effectively. Here is a small tutorial on how to use SGE.


4

I'd recommend that you set up your conference rooms as resources. You can then use resource booking to prevent this from happening. Have a look at this article from MSExchange.org for Exchange 2003. Here are articles for Exchange 2007 for making Resource Mailboxes. Part 1 Part 2 Part 3


4

Two solutions spring to mind: Use xargs -P to control the maximum parallel processes at one time. Create a Makefile and spawn with make -j. They are actually both summarised in this SO thread in more detail. There is a possibility that these may not be applicable to the structure of your scripting.


4

With regards to pico it's unlikely to ever be much cause for concern so it's not the kind of command you would normally nice/renice or ionice. However your command would execute pico niced to +13. Which would mean it would get significantly less time allocated to it. For example, following on from your pico line. Normally pico executed looks like this: ...


3

Automation can be done by creating CRON jobs on your server. The following link has complete example code to backup the database automatically http://atoztechnical.blogspot.com/2010/08/how-to-automate-database-backups.html or First write a script that uses mysqldump command to backup your database and store in specific directory.Now we are going to ...


3

You might want to read the MySQL documentation on Database Backup Methods. PHPMyAdmin has an "Export" option you can use to backup your database, but there is no way to automate this. Automating a backup of MySQL usually requires creating a CRON Job that calls mysqldump. There are other ways to do it, such as with a file system snapshot, but using ...


3

this is good links to start : 10 Ways to Automatically & Manually Backup MySQL Database http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html How to setup and verify a backup solution for MySQL in 15 minutes - all using open source software http://www.zmanda.com/quick-mysql-backup.html


3

Disk i/o scheduler are set per spindle. You can change the scheduling algo for /dev/sda,sdb etc which are real, hardware , devices in your system. Software raid block devices are virtual. Ionice is not related to software raid and it simple gives priority of one process over another when accessing the storage. So yes, you can use it with no matter what type ...


3

Take a look at JobScheduler - http://jobscheduler.sourceforge.net/ It's free/opensource and very robust. I am currently in the process of implementing this here at work. It's very well documented.


3

I'd set up some kind of queueing service. A quick Google on "ready to use" stuff shows this: http://sqs.sourceforge.net/ Depending on your needs you could simply create a wrapper where users submit jobs, the wrapper writes the job to a socket/file/whatever create a consumer that runs job by job waiting for it to finish the consumer is then called ...


3

nice priority numbers only matter in relation to other processes. It's up to you to determine the structure you want and how much granularity you need. You can think of it as 3 for very low granularity or 5 groups for better granularity instead of the full range, e.g., High, Medium, Normal, Low, Really Low, and give those an arbitrary number value, say -19, -...


2

You can always use lpd -- yeah, old school, but it's really a generalised batch processing control system masquerading as a print server.


2

The way I have done this is to run the task from a batch file that starts once a day shortly after midnight and runs until next midnight. The advantag of this is that because it's a single script you cannot get a second instance running. I suppose a disadvantage might be that you can predict exactly how often the script runs because it would wait a set time ...


2

You can use a lock file. Create this file when the script starts and delete it when it finishes. The script, before it runs its main routine, should check if the lock file exists and proceed accordingly. Lockfiles are used by initscripts and by many other applications and utilities in Unix systems.


2

Chris Siebenmann recently came to the same conclusion as you: ionice has no effect on either "software raid" (I presume this means MD) or LVM. http://utcc.utoronto.ca/~cks/space/blog/


2

Well, I found this on http://www.spinics.net/lists/linux-rt-users/msg03987.html which explains the difference pretty nicely: "nice" is an historic utility which was used in the early days of batch computing to be "nice" to other users and give up some CPU time. It's still in use and useful and applies only to processes which run with the ...


2

chrt(1) is used not only to change the priority of a process, but also the scheduling policy. The scheduling policy can be four: SCHED_FIFO=first in, first out, real time processes. SCHED_RR=round robin real time processes. SCHED_OTHER=normal time sharing SCHED_BATCH=almost the same as the SCHED_OTHER, but the process is considered always the most ...


2

Grant the CAP_SYS_NICE capability.


2

ionice is an interface to the IO scheduler subsystem of the Linux kernel, it allows for setting IO priorities on a per process basis. The use-case of that would be something like reducing the priority of the updatedb command that builds the database for the locate command in a way that other IO is running undisturbed as updatedb only gets to do IO when no ...


2

It's probably fair to ask what type of platforms you're concerned about managing. I'm assuming Linux, but the concept applies to Windows systems as well... You are looking for a job scheduler. It's not an easy thing to get into, but can potentially help scalability and would manage your inter-process dependencies. A good solution to start with is the Open ...


2

Yes, you can configure and run more virtual CPUs than physical cores available. This is an idle Windows Server 2008 (x86, German) KVM guest showing 10 CPUs on a 4-core single-CPU Intel X3210 machine: But you only should do so when you know, what you are doing: For one, this will be accompanied by the overhead of timing / synchronizing more virtual CPUs ...


2

You have it correct in your comment to Abhishek's answer. 0 0 1 3,7,11 * /path/to/file In this case the "/" won't do what you're after.


2

You can disable processors for example (core0) with echo 0 > /sys/devices/system/cpu/cpu0/online and enable with echo 1 > /sys/devices/system/cpu/cpu0/online You can verify the state with cat /proc/cpuinfo


2

Generic answer... until you provide more information. You may want to use the CPU isolation tool of choice for your distribution. Also, cgroups may be relevant, depending on what you specifically trying to accomplish. difference between taskset and cpuset Edit: You're looking for a CPU shield. On EL6, you may want to read up on cgroups and the cgred ...



Only top voted, non community-wiki answers of a minimum length are eligible