Sponsored Content
Full Discussion: temporarily suspend crontab
Top Forums Shell Programming and Scripting temporarily suspend crontab Post 302344755 by avronius on Monday 17th of August 2009 01:12:29 PM
Old 08-17-2009
One way is to use a control file for any "state" oriented scripts.

Create a directory in /var/tmp called "croncontrol"
Create a script called "disable" that accepts variables depending on the cronjob name (backup, reportmailer, etc).
This script will touch /var/tmp/croncontrol/backup or /var/tmp/reportmailer, etc.

Create a wrapper for your cron script (or add a line to the existing cron script) that checks for the file /var/tmp/croncontrol/backup (or mailer or whaterver). If the file exists, exit and do not run (although I'd recommend that it mail out that the script is not being run). If the file does not exist, proceed with the normal script function.

To enable the cron scripts to run again, write a simple script that accepts the same variables to rm the 'touched' file in /var/tmp/croncontrol.

Simple - but not terribly robust.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX Process Suspend

Hi, I have this doubt.... When some program is running and if we press CTRL+Z...it is suspended... what should we do to continue its execution I know that KILL can be used to completely terminate the process....but is there any way to continue... Thanks (3 Replies)
Discussion started by: proton
3 Replies

2. Shell Programming and Scripting

suspend a process

Hello, Two child processes work at the same time because they communicate one another. In KSH, does it exist a good way to suspend a parent process until one of the two child processes stops. It seems that the command 'wait' works well for one process but for two processes, it suspends the... (7 Replies)
Discussion started by: piou78
7 Replies

3. UNIX for Advanced & Expert Users

Suspend to write file

We have a common directory , everyone can put file to it , but I found that there is a problem if the user continouosly write files to this directory while the another application is running at the same time , so I want temporaily "protect" the directory , no files can be write to it at a specific... (3 Replies)
Discussion started by: ust
3 Replies

4. Solaris

Suspend in opensolaris

How does one enable the suspend to hard drive or ram and sleep features on a desktiop running Open Solaris? (2 Replies)
Discussion started by: FloridaBSD
2 Replies

5. Shell Programming and Scripting

How to suspend a user account?

Hi, guys. I have two questions: I need to write a script, which can show all the non-suspended users on system, and suspend the selected user account. There are two things I am not sure: 1. How can I suspend user's account? What I think is: add a string to the encrypted password in shadow... (2 Replies)
Discussion started by: daikeyang
2 Replies

6. Shell Programming and Scripting

Suspend of crontab temprorarily

Hello Friends, I would like to find out if there is a way to suspend crontab script? I need to suspend the scheduling of crontab scripts in case of an alarm and when alarm ends need to start them again automaticaly, could you suggest me a method? one of participiant of the forum with name... (6 Replies)
Discussion started by: EAGL€
6 Replies

7. Solaris

Solaris 10 Suspend System

One of our Solaris 10 Guru's created a Solaris 10 image and he disabled the Suspend System option. How do I enable it again? example right click on the desktop the go to the bottom Suspend System in grayed out. Any help would be great. ---------- Post updated at 09:02 PM ----------... (1 Reply)
Discussion started by: deaconf19
1 Replies

8. UNIX for Dummies Questions & Answers

suspend a *background* running job

Is there a way to suspend (TSTP?) a job that is running in the background, _without_ first bringing it to the foreground and inputting Ctrl-Z from the keyboard? IOW, something similar to issuing the shell's bg builtin command on a job ID to resume a job that is suspended in the background,... (2 Replies)
Discussion started by: uiop44
2 Replies

9. UNIX for Advanced & Expert Users

Hibernate and Suspend

I have a C++ program which ends up getting run on every conceivable distro. What I can't do in C++, I can do by shelling out to the O/S. I am trying to find a portable way to send the system into hibernate and suspend modes. For users who have pm-utils, of course, I can use that, but I am trying... (4 Replies)
Discussion started by: BrandonShw
4 Replies
svn-backup-dumps(1)					      General Commands Manual					       svn-backup-dumps(1)

NAME
svn-backup-dumps - Create dumpfiles to backup a subversion repository. SYNOPSIS
svn-backup-dumps <repos> <dumpdir> DESCRIPTION
svn-backup-dumps creates dumpfiles from a subversion repository. It is intended for use in cron jobs and post-commit hooks. The basic modes of operation are: o Create a full dump (revisions 0 to HEAD) o Create incremental dump containing at most N revisions. o Create incremental single-revision dumps (for use in post-commit). Dumpfiles are named in the format basename.rev.svndmp or basename.rev.rev.svndmp, where basename is the repository directory name, and the rev arguments are the first and last revision numbers represented in the dumpfile, zero-padded to 6 digits. Optionally, svn-backup-dumps can compress dumpfiles with gzip or bzip2, and can transfer them to another host using FTP or SMB (using smb- client). OPTIONS
--version Show program's version number and exit. -h, --help Show this help message and exit. -b Compress the dump using bzip2. --deltas This is passed through to svnadmin dump. -c count Maximum number of revisions per dumpfile. -o Overwrite files. -O Overwrite all files. -q Quiet. -r rev Specify a single-revision dumpfile. -t ftp:host:user:password:path -t smb:share:user:password:path Transfer dumps to another machine using the FTP or SMB protocols. path is where to store the dumpfiles on the remote server; any occurrence of %r in the path is replaced by the repository name. Support for "smb:" requires the smbclient program. -z Compress the dump using gzip. EXAMPLES
To create a full dump of all revisions of a repository /srv/svn/foo in the directory /var/backup/svn: svn-backup-dumps /srv/svn/foo /var/backup/svn The dumpfile will be named src.000000-NNNNNN.svndmp.gz where NNNNNN is the head revision number. To create incremental dumps containing at most 1000 revisions: svn-backup-dumps --deltas -z -c 1000 /srv/svn/foo /var/backup/svn If the youngest revision is 2923, it creates the following files: foo.000000-000999.svndmp.gz foo.001000-001999.svndmp.gz foo.002000-002923.svndmp.gz If run again, later, when the youngest revision is 3045, it creates these two files: foo.002000-002999.svndmp.gz foo.003000-003045.svndmp.gz Note that it does not remove the redundant file foo.002000-002923.svndmp.gz. To create incremental single-revision dumps from a post-commit hook: svn-backup-dumps -r $rev $repos /var/backups/svn where $rev and $repos are variables previously set in the post-commit script from its command line. The dumpfile name will be in the form foo.000352.svndmp. To send the dumpfiles to the SMB share \ERNESTBACKUPS in a directory svnfoo with user svnuser and password w0rth1ng: svn-backup-dumps -t "smb://ERNEST/BACKUPS:svnuser:w0rth1ng:svn/%r /srv/svn/foo /tmp/tmpbackup Note that the %r in the path is replaced by the repository name foo. Note also that a local backup directory is required, at present, even when using the -t option. AUTHOR
Voluntary contributions made by many individuals. Copyright (C) 2006 CollabNet. 2006-11-09 svn-backup-dumps(1)
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy