* [gentoo-user] Moving a file using Python and Cron
@ 2007-09-07 17:34 Greg Lindstrom
2007-09-09 9:37 ` Jan Seeger
0 siblings, 1 reply; 2+ messages in thread
From: Greg Lindstrom @ 2007-09-07 17:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
I have a python (2.4) routine running on Gentoo Linux. It creates a file
and, after the file is complete, renames the file using Python's os.rename()
command. When I run the file from the command line everything works great,
but when I schedule the job to run from the crontab file, the original file
is created and populated, but the rename fails. I am using full paths for
both the original and destination file, and run the command line version
after I 'su' to the production account (named 'edith'). I am told by my
sysadmin that the cron jobs run as edith as well, so he does not think it is
a permission issue (he points out the original file is being created and
populated as expected...the rename fails)
Have any of you dealt with anything like this? It really has me scratching
my head.
Thanks,
--greg
[-- Attachment #2: Type: text/html, Size: 903 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-user] Moving a file using Python and Cron
2007-09-07 17:34 [gentoo-user] Moving a file using Python and Cron Greg Lindstrom
@ 2007-09-09 9:37 ` Jan Seeger
0 siblings, 0 replies; 2+ messages in thread
From: Jan Seeger @ 2007-09-09 9:37 UTC (permalink / raw
To: gentoo-user
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12:34 Fri 07 Sep , Greg Lindstrom wrote:
<snip>
> When I run the file from the command line everything works great,
> but when I schedule the job to run from the crontab file, the original file
> is created and populated, but the rename fails. I am using full paths for
> both the original and destination file, and run the command line version
> after I 'su' to the production account (named 'edith').
<snip>
I think cronjobs have a very limited environment (Reduced $PATH and so on). So
the first point I would check ist that my application does not depend on any
environment variables (call all binaries with their full path, for example).
Then, make sure that the user you are running at has the necessary permissions
to do so (does'nt seem to be a problem with you). And another thing: The cron
processes have no controlling terminal, so that's something which may go awry.
HTH
Jan Seeger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFG477iMmLQdC6jvocRAgGKAJ9iali9yPgTUgz68t/Vn5wf9UHWtgCfTVnJ
yQmdQd4SmO88bR9W7tIwdD4=
=WlTn
-----END PGP SIGNATURE-----
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-09 9:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-07 17:34 [gentoo-user] Moving a file using Python and Cron Greg Lindstrom
2007-09-09 9:37 ` Jan Seeger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox