Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Running an Exec file with Cron



On Mon, 2002-06-17 at 18:54, Jim Breen wrote:
> [Charles Muller ([tlug] Running an Exec file with Cron) writes:]
> >> 
> >>      * */1 * * * /home/chuck/bin/backups
> 
> That's getting closer. Does the "backups" script file begin with a "#", or
> to force the shell "#!/bin/sh"?


Yes, it's like this (extra returns added for clarity):

------------------------------------------------

#!/bin/bash

cp -rvu /home/chuck/send /mnt/win_d/docs

tar czvfP /mnt/win_h/restore/linux/tar/evol.tar.gz /home/chuck/evolution

tar czvfP /mnt/win_h/restore/linux/tar/Documents.tar.gz
/home/chuck/Documents

tar czvfP /mnt/win_h/restore/linux/tar/chuck-bin.tar.gz /home/chuck/bin

cp -rvu /home/chuck/Documents/h-buddhism /mnt/win_d/docs/H-Buddhism

TIMESTAMP=`date +%Y%m%d`

cp -f /home/chuck/.emacs /home/chuck/Documents/programming/emacs-`date
$TIMESTAMP.txt

------------------------------------------------


And this runs fine from a terminal prompt.


As long as I know that an exec file like this is *supposed* to work with
Cron, at least I know that I have to look elsewhere, and I suspect at
this moment that the problem may have something do to with the
permissions in the target files.

I know that part of the reason for my difficulty is that I am trying to
see if I can set this all up as a regular user, rather than as SU, so
that I can have easier access to the backed up files later on as needed.

But even though I set the permissions to my mounted external drives
(FAT) to "chuck", they keep reverting to root. It also seems like even
though I can create a crontab file as a regular user, it won't run. I'll
play around with it a little more.

Thanks,

Chuck




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links