Sponsored Content
Full Discussion: temporarily suspend crontab
Top Forums Shell Programming and Scripting temporarily suspend crontab Post 302345063 by Paul.S on Tuesday 18th of August 2009 10:25:40 AM
Old 08-18-2009
Thank you very much avronius!

Your script worked like a charm.

I just followed your procedure and created crontab and was able to enable and disabled the cron schedule.

Code:
00 11 * * 3 /usr/local/bin/weekselector odd && /usr/local/bin/archTEST/test/even.sh > /usr/local/bin/archbakTST/test/odd_wed.log 2 >&1
00 11 * * 4 /usr/local/bin/weekselector even && /usr/local/bin/archTEST/test/even.sh > /usr/local/bin/archbakTST/test/even_thr.log 2 >&1
#
# This Cron job will be disabled with command
#
20 10 * * * [ ! -f /var/tmp/croncontrol/backup ] && /usr/local/bin/archTEST/test/even.sh > /usr/local/bin/archbakTST/test/100_with_switch.
log 2 >&1

and used your on and off switch command

Code:
$ ./manageCron -e backup  << enable
$ ./manageCron -d backup  << disable

and test output log was created whenever cron was enabled.


My last question will be is there any particular significant to parameter backup ?

I created /var/tmp/croncontrol but "on and off" command really doesn't do anything with backup parameter.



thank you.

Last edited by Paul.S; 08-19-2009 at 02:38 PM..
 

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
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/ksh93 /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/ksh93 /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/sfw/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. NOTES
Restricted shells should not be listed in /etc/shells. SunOS 5.11 1 Nov 2007 getusershell(3C)
All times are GMT -4. The time now is 01:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy