Can't use cron or at - any other options?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can't use cron or at - any other options?
# 1  
Old 01-26-2012
Can't use cron or at - any other options?

I am not authorised to use cron or at to perform periodic backups. Are there any other options available that would not require elevated permissions?
# 2  
Old 01-26-2012
cron or at does not require elevated permission but only be permitted by root: either you are present in cron.deny or at.deny, either you are not in cron.allow or at.allow, second being more likely...
get yourself in /var/adm/cron/cron.allow and you will be able to use crontab files (must be root to edit cron.allow...), look at the man pages of crontab...

or use a loop with a sleep of 86400 ...

Last edited by vbe; 01-26-2012 at 03:41 AM..
# 3  
Old 01-26-2012
You can write a while true script and fork it and background to run indefinely until it matches certain conditions (time a day, number of backup etc.)

This is a sample code without any error handling.

Code:
TIME=$(date "+%H%M")
while true
do
     case $TIME in
     0856) echo "do smth in 08:56"
     ;;
     1010) echo "do smth in 10:10"
     ;;
esac
sleep 1
done

Your paste it into a shell script and run it like
Code:
bash scriptname.sh &

That way scriptname.sh will be shown in ps -ef | grep scriptname.sh, so you can stop it by force (kill on pid or alike)

But rather user cron or at, that's what they are made for.

Hope that helps
Regards
Peasant.
# 4  
Old 02-08-2012
Quote:
Originally Posted by vbe
cron or at does not require elevated permission but only be permitted by root: either you are present in cron.deny or at.deny, either you are not in cron.allow or at.allow, second being more likely...
get yourself in /var/adm/cron/cron.allow and you will be able to use crontab files (must be root to edit cron.allow...), look at the man pages of crontab...

or use a loop with a sleep of 86400 ...
These are company servers that are locked down by a security system called KeON so yeah I'm probably in one of those files or there's some sort of group definition keeping admins in my function from doing anything like that.

---------- Post updated at 12:48 PM ---------- Previous update was at 12:46 PM ----------

Quote:
Originally Posted by Peasant
You can write a while true script and fork it and background to run indefinely until it matches certain conditions (time a day, number of backup etc.)

This is a sample code without any error handling.

Code:
TIME=$(date "+%H%M")
while true
do
     case $TIME in
     0856) echo "do smth in 08:56"
     ;;
     1010) echo "do smth in 10:10"
     ;;
esac
sleep 1
done

Your paste it into a shell script and run it like
Code:
bash scriptname.sh &

That way scriptname.sh will be shown in ps -ef | grep scriptname.sh, so you can stop it by force (kill on pid or alike)

But rather user cron or at, that's what they are made for.

Hope that helps
Regards
Peasant.
I like this idea - I'll try it out. If I have to re-push it every week or something I wouldn't have a problem with that at all. Just anything where I won't have to do it daily. Thanks!
# 5  
Old 02-09-2012
What backup solution do you use and what backups are we talking about?
Do you backup to a tape library or something similar? Most tape libraries I worked with were able to initiate backups so there is no need to schedule anything at client side.
Is it a database you wish to backup? Some come with their own scheduling mechanism that can initiate backups too.
# 6  
Old 02-10-2012
Quote:
Originally Posted by cero
What backup solution do you use and what backups are we talking about?
Do you backup to a tape library or something similar? Most tape libraries I worked with were able to initiate backups so there is no need to schedule anything at client side.
Is it a database you wish to backup? Some come with their own scheduling mechanism that can initiate backups too.
No this is really simple stuff that would simply make my work a little easier. Things like going out to each server, getting a copy of the /etc/passwd file, putting all of them into 1, unique file, separating it by fields, processing a report that comes to me each week, little stuff like that.
# 7  
Old 02-13-2012
about job automation

first u type edit=vi
then u type editor=vm
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

2. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

6. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. AIX

AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log

Hi, I can use 'crontabs –e' and do all the scheduling I like. However I would like to auto send myself just the cronjobs logs that fail. That is to say the PIDs that fail and the related lines with those PID’s only. (Not the full set of logs) Has anyone done this work? Or does an AIX 5.3 tool... (0 Replies)
Discussion started by: Keith Johnson
0 Replies
Login or Register to Ask a Question