Go to page | Previous  1 2 3 4 5
 Post subject: Re: My first cron job
PostPosted: Mon Nov 02, 2009 4:21 pm 
   
On Oct 31, 2:34 pm, "David W. Hodgins"
wrote:
Quote:
Add "set -x -v" as the first line after the shebang, so that there
will be a trace in the output, which will be mailed to root.  Make
sure you have postfix installed, and the alias for root set to your
id in /etc/postfix/aliases.

Thank you; now we're on to something. Here's the relevant portion of
what I am mailed:

(snip)
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
Date: Mon, 2 Nov 2009 10:00:01 -0600 (CST)
Status: R
# Back up hard disk to DVD using dkopp
/usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
+ /usr/local/bin/dkopp -script /root/.dkopp/jobfile_script

(dkopp:15622): Gtk-WARNING **: cannot open display:
(snip)

As best I understand the above, the command fails because the GUI is
unable to launch when run as a cron job. Speculating, I'd guess this
is an env problem, because the same command given as root works. Any
thoughts on what to change in my env?

A better solution is to not have a GUI launched as a cron job. I've
already asked the software author about running it without the GUI and
am told this is not currently an option. For the medium term then I
will look for a backup solution more appropriate for a cron job. But
is there a quick env fix to make this work in the meantime? I don't
want to go even one more day without automatic backups, even if it
takes me a while to find the ideal solution.


 
 Post subject: Re: My first cron job
PostPosted: Mon Nov 02, 2009 4:56 pm 
On Mon, 2 Nov 2009 08:21:09 -0800 (PST), Warren wrote:
Quote:
On Oct 31, 2:34 pm, "David W. Hodgins" wrote:
Add "set -x -v" as the first line after the shebang, so that there
will be a trace in the output, which will be mailed to root.  Make
sure you have postfix installed, and the alias for root set to your
id in /etc/postfix/aliases.

Thank you; now we're on to something. Here's the relevant portion of
what I am mailed:

(dkopp:15622): Gtk-WARNING **: cannot open display:
(snip)

You might try adding a line like
export DISPLAY=:0

Of course, that assumes you will be logged in at the time of the cron
run for the opening of display. That will not help if app wants you to
enter something into the "display"


 
 Post subject: Re: My first cron job
PostPosted: Mon Nov 02, 2009 5:20 pm 
On Nov 2, 10:56 am, Bit Twister wrote:
Quote:
You might try adding a line like
export DISPLAY=:0

Of course, that assumes you will be logged in at the time of the cron
run for the opening of display. That will not help if app wants you to
enter something into the "display"

Done, then I let the cron job run as root. I am calling the app with a
script, so it will not need manual input from me. The trace now reads
in part:

(snip)
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
Date: Mon, 2 Nov 2009 11:10:01 -0600 (CST)
Status: R
# Try to fix dkopp "cannot open display" issue per
# http://groups.google.com/group/alt.os.l ... 443e5ee1cc
export DISPLAY=:0
+ export DISPLAY=:0
+ DISPLAY=:0
# Back up hard disk to DVD using dkopp
/usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
+ /usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
No protocol specified
(dkopp:30804): Gtk-WARNING **: cannot open display: :0
(snip)


 
 Post subject: Re: My first cron job
PostPosted: Mon Nov 02, 2009 6:52 pm 
On Mon, 2 Nov 2009 09:20:51 -0800 (PST), Warren wrote:
Quote:
On Nov 2, 10:56 am, Bit Twister wrote:
You might try adding a line like
export DISPLAY=:0


Done, then I let the cron job run as root. I am calling the app with a
script, so it will not need manual input from me. The trace now reads
in part:

# Try to fix dkopp "cannot open display" issue per
# http://groups.google.com/group/alt.os.l ... 443e5ee1cc
export DISPLAY=:0
+ export DISPLAY=:0
+ DISPLAY=:0
# Back up hard disk to DVD using dkopp
/usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
+ /usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
No protocol specified
(dkopp:30804): Gtk-WARNING **: cannot open display: :0

I am out of suggestions. I am normally logged in as bittwister desktop
started with startx.

I have cron jobs which use xmessage to popup messages on bittwister's
desktop. Those jobs are running of /etc/cron.daily.


 
 Post subject: Re: My first cron job
PostPosted: Tue Nov 03, 2009 11:44 pm 
Warren wrote:

Quote:
On Nov 2, 10:56 am, Bit Twister wrote:
You might try adding a line like
export DISPLAY=:0

Of course, that assumes you will be logged in at the time of the cron
run for the opening of display. That will not help if app wants you to
enter something into the "display"

Done, then I let the cron job run as root. I am calling the app with a
script, so it will not need manual input from me. The trace now reads
in part:

(snip)
Auto-Submitted: auto-generated
X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Date: Mon, 2 Nov 2009 11:10:01 -0600 (CST)
Status: R
# Try to fix dkopp "cannot open display" issue per
#
http://groups.google.com/group/alt.os.l ... 443e5ee1cc
export DISPLAY=:0
+ export DISPLAY=:0
+ DISPLAY=:0
# Back up hard disk to DVD using dkopp
/usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
+ /usr/local/bin/dkopp -script /root/.dkopp/jobfile_script
No protocol specified
(dkopp:30804): Gtk-WARNING **: cannot open display: :0
(snip)

The implication here is that user root has to be logged in and running an X
server. As Bit Twister mentioned, he logs in as a specific user, I log in
as my user 'jerry' and stay logged in all the time.

Since root isn't logged in all the time, is the user jorge (IIRC) logged in?
If so, then you're back to using the user's crontab rather than root's.

jerry
--
// Jerry Heyman | "It's not a 'right' if someone else
// Amiga Forever :-) | has to pay for it" - Ayn Rand
\\ // heymanj at acm dot org |
\X/ http://www.hobbeshollow.com


 
 Post subject: Re: My first cron job
PostPosted: Wed Nov 04, 2009 1:43 am 
On Tue, 03 Nov 2009 09:44:08 -0600, Jerry Heyman wrote:

Quote:
The implication here is that user root has to be logged in and running
an X
server. As Bit Twister mentioned, he logs in as a specific user, I log
in
as my user 'jerry' and stay logged in all the time.

Since root isn't logged in all the time, is the user jorge (IIRC) logged
in?
If so, then you're back to using the user's crontab rather than root's.

Sounds like this particular software just isn't going to do what I want,
then. It needs to run as root to have access to the non-user files it is
backing up, and it doesn't run with sudo. I'll look for another backup
solution. Thanks everyone for your help: even though I can't do what I
wanted, I did finally learn about cron jobs.

Anticipating this, I had a friend over for pizza and beer and to teach me
bacula last night. After two hours I felt like I was trying to use a
hammer to swat a fly. Oh well, at least the pizza and beer were good.


 
 Post subject: Re: My first cron job
PostPosted: Wed Nov 04, 2009 2:24 am 
Warren Post wrote:

Quote:
On Tue, 03 Nov 2009 09:44:08 -0600, Jerry Heyman wrote:

The implication here is that user root has to be logged in and running
an X
server. As Bit Twister mentioned, he logs in as a specific user, I log
in
as my user 'jerry' and stay logged in all the time.

Since root isn't logged in all the time, is the user jorge (IIRC) logged
in?
If so, then you're back to using the user's crontab rather than root's.

Sounds like this particular software just isn't going to do what I want,
then. It needs to run as root to have access to the non-user files it is
backing up, and it doesn't run with sudo. I'll look for another backup
solution. Thanks everyone for your help: even though I can't do what I
wanted, I did finally learn about cron jobs.

doesn't work with 'sudo'? You can set sudo to not prompt you for a passwd.

Quote:
Anticipating this, I had a friend over for pizza and beer and to teach me
bacula last night. After two hours I felt like I was trying to use a
hammer to swat a fly. Oh well, at least the pizza and beer were good.

I have a Travan TR4 tape drive attached to my machine (8GB compressed)
and just use the 'tar' command to create a weekly backup. I could do it
incrementally, but I don't have enough data to save off now that I've
finished my dissertation.

jerry
--
// Jerry Heyman | "It's not a 'right' if someone else
// Amiga Forever :-) | has to pay for it" - Ayn Rand
\\ // heymanj at acm dot org |
\X/ http://www.hobbeshollow.com


 
 Post subject: Re: My first cron job
PostPosted: Wed Nov 04, 2009 2:38 am 
On Tue, 03 Nov 2009 12:24:01 -0600, Jerry Heyman wrote:

Quote:
doesn't work with 'sudo'? You can set sudo to not prompt you for a
passwd.

Even running it manually from a terminal, it chokes. dkopp itself runs
fine with sudo, but it is a wrapper for some other stuff, one of which
doesn't like to run sudo. I don't remembe what exactly -- I'm at home at
the moment, not on my friend's machine -- but I do recall sudo was a show
stopper when I was trying to run it as a user cron job.

Taking a step back, I believe the ideal solution would be something that
doesn't require an X session to run. Thus my looking into command line
alternatives like bacula. Or convince him to buy two USB sticks and we do
A/B rsyncing to them.

Quote:
I don't have enough data to save off now that I've
finished my dissertation.

Well, congratulations are in order: lots of people start dissertations
they never finish. What are you studying?


 
 Post subject: Re: Question about dissertation (was Re: My first cron job
PostPosted: Thu Nov 05, 2009 5:12 am 
On Wed, 04 Nov 2009 13:23:21 -0600, Jerry Heyman wrote:

Quote:
Point I was making is that I don't back up often enough anymore

That happens to everyone I know, myself included. I've concluded that the
best solution -- for psycological reasons, not technical ones -- is
scheduled automatic backups. Otherwise even people who know better get
complacent or forgetful or busy.

Quote:
Unfortunately, that attitude bit me in the
butt a few months ago as I was beta testing Opera 10 and it ate my
bookmarks
file. I hadn't backed up in almost a year, so recovering it wasn't of
much
use.

It doesn't do you any good now, nor does it minimize your broader point of
the necesity of backups, but Opera since verion 9 has a syncronization
service. Set it up and your bookmarks and notes are saved to an Opera
server. I use it to have web based access to my bookmarks when I'm away
from my computer, but you could also use it to recover from the next time
you forget to back up.

Firefox users can get an addon that does something similar.


 
 Post subject: Re: Question about dissertation (was Re: My first cron job
PostPosted: Thu Nov 05, 2009 6:17 am 
Warren Post wrote:
Quote:
It doesn't do you any good now, nor does it minimize your broader point of
the necesity of backups, but Opera since verion 9 has a syncronization
service. Set it up and your bookmarks and notes are saved to an Opera
server. I use it to have web based access to my bookmarks when I'm away
from my computer, but you could also use it to recover from the next time
you forget to back up.

Firefox users can get an addon that does something similar.

The XMarks plugin for firefox can sync bookmarks from different PCs. I use
it to keep my work and home bookmarks synchronised. You can also log on to
the XMarks website to get to your bookmarks for example if you're using an
internet cafe. I believe it works with Safari (Mac) and dare I say IE (MS
Windows) too now. For Safari the installer won't work on anything earlier
than Leopard though, and I haven't bothered trying it on IE.

--
http://www.slowbicyclemovement.org/


 
Go to page | Previous  1 2 3 4 5





SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
 © 0x61.com 2009 - Internet Forums and much more! - All rights reserved.