There is a program that we (a company I'm working for) would like to run once per day, and the approach we're taking is to create a fake user to give a location to the data for this program, and to be the user running the program. For the sake of the discussion, let me call the fake user "bob".
Since there is no actual person called bob, there is no reason to allow anyone to login as bob. If someone needs to do something to bob's data or programs, then they can su to bob.
Here's the problem: When I create a crontab for bob, it doesn't seem to run. Is there some reason that disabling logins would effect the ability to run crontab?
Here's a clue, perhaps. When I try to su to bob using
sudo su bob
I get the error message:
>Your account has expired; please contact your system administrator
>su: Authentication failure
>(Ignored)
But afterwards, whoami says that I am now bob. So I don't understand what that failure message means.
You did not say what OS you are running... and disabling an account is not the same as nologin
Nologin is used by some OS e.g. for FTP accounts, you cannot log in to the server (meaning having a proper login shell...) but the account is enabled and may have a passwd... really not the same as disabled....
Accounts can exist with several status settings - no network login, locked, active.
On most systems:
will show you the status. Also unless you have something like:
in /etc/sudoers, you have to be root to execute authentication setup procedures.
The correct command to become bob and get the "bob" environment:
Note the dash with spaces around it.l
And what you want to do is common on every Linux/unix box - permanently locked user accounts like noaccess, lp have been part of the unix scene for a really really long time.
cron and at jobs will be not be executed if the user’s account is locked. Only accounts which are not locked as defined in shadow(4) will have their job or process executed.
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)
I am trying a cron on root user to backup to tape using TAR command
here is the cron entry
11 08 * * 6 /erdhot1cron 2>&1 >> /test3/scripts/dba/erdhot1cron.log
here is script inside - edhot1cron
#!/bin/bash
vsysdt=`date +%d%m%y`
date
tar -cvf /dev/st0... (4 Replies)
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)
Hi,
Should the user jobs specified in crontab be running in background?
Cron daemon is already running in background. So I am not sure
whether should the jobs (output and error messages are redirected to file)
ran by it be explicitly stated to be run in background (& at end of command)
if one... (1 Reply)
I've been bashing my head on the desk for 2 days trying to get this to work, but I've had no luck. I'll try to be as clear as possible in my explanation without dragging out the details. I'm trying to set up a cron job for user "john" which runs a script. This script initiates an ssh connection to... (5 Replies)
My shell script runs fine both as a cron job and when i issue it.
However, I wish to differentiate when it runs as a cron-job so the "echo" statements are not issued (they get mailed to me, which i don't want).
I tried checking $USER but since the cron was created in my user that does not... (5 Replies)
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)