Fun with Cron

Fun with Cron

Post by Franoculato » Sat, 05 Apr 2003 11:20:09



Strange...

I have a little backup script that I use at the office.  It basically
copies files off of a win2k server.

When I execute this script manually, it works flawlessly.  When run via
cron, however, it only copies the first 3 directories on the disk, then
umounts the win2k share.

Any suggestions?

--
Matt

"Windows is a commercial OS, you don't like it then don't buy it"
    - Written by a wintroll in COLA on January 22, 2003

 
 
 

Fun with Cron

Post by CTE » Sat, 05 Apr 2003 11:33:43



> Strange...

> I have a little backup script that I use at the office.  It basically
> copies files off of a win2k server.

> When I execute this script manually, it works flawlessly.  When run via
> cron, however, it only copies the first 3 directories on the disk, then
> umounts the win2k share.

> Any suggestions?

Is it run by a different shell or with different priviledges than you
run it manually in.

--
Chris Engel
CTE Net
http://ctenet.cjb.net/


 
 
 

Fun with Cron

Post by Franoculato » Sat, 05 Apr 2003 11:42:55


CTE spilled his alphabet soup on the floor,
and the letters spelled:


>> Strange...

>> I have a little backup script that I use at the office.  It basically
>> copies files off of a win2k server.

>> When I execute this script manually, it works flawlessly.  When run via
>> cron, however, it only copies the first 3 directories on the disk, then
>> umounts the win2k share.

>> Any suggestions?

> Is it run by a different shell or with different priviledges than you
> run it manually in.

Nope.  I log in with a normal user account, which has permission to
mount the win2k share.  Files are copied to the /home/backup.
Permissions shouldn't be at fault here.  

When running via cron, the scripts is executed as user "backup" just
like when I log in.

--
Matt

"Windows is a commercial OS, you don't like it then don't buy it"
    - Written by a wintroll in COLA on January 22, 2003

 
 
 

Fun with Cron

Post by Sybren Stuve » Sat, 05 Apr 2003 21:52:54


Franoculator enlightened us with:

Quote:> When running via cron, the scripts is executed as user "backup" just
> like when I log in.

Can you post the script here?

Sybren
--
| Somebody ought to cross ball point pens with coat hangers so that |
| the pens will multiply instead of disappear.                      |
\-------------------------------------------------------------------/
If you have to use Outlook, fix it: http://jump.to/oe-quotefix

 
 
 

Fun with Cron

Post by Franoculato » Sun, 06 Apr 2003 09:01:22


Sybren Stuvel spilled his alphabet soup on the floor,
and the letters spelled:

Quote:> Franoculator enlightened us with:
>> When running via cron, the scripts is executed as user "backup" just
>> like when I log in.

> Can you post the script here?

> Sybren

=====BEGIN PASTE=====

BU_DATE=`date +%D | tr / -`
export BU_DATE
mount -t smbfs -r -o username=user,password=passwd //server/data /mnt/backup
mkdir /mnt/backup/$BU_DATE
cp -Rf /mnt/backup/* /home/backup/$BU_DATE/
umount /mnt/backup

======END PASTE======

--
Matt

"Windows is a commercial OS, you don't like it then don't buy it"
    - Written by a wintroll in COLA on January 22, 2003

 
 
 

Fun with Cron

Post by Sybren Stuve » Sun, 06 Apr 2003 09:25:17


Franoculator enlightened us with:

Quote:> mkdir /mnt/backup/$BU_DATE
> cp -Rf /mnt/backup/* /home/backup/$BU_DATE/

You create a new directory, and then you copy all files from that new
directory (ergo: no files) to /home/backup/$BU_DATE. I think you got
some arguments mixed up:

# cp -Rf /home/backup/* /mnt/backup/$BU_DATE/

Sybren
--
| Somebody ought to cross ball point pens with coat hangers so that |
| the pens will multiply instead of disappear.                      |
\-------------------------------------------------------------------/
If you have to use Outlook, fix it: http://jump.to/oe-quotefix

 
 
 

Fun with Cron

Post by Franoculato » Wed, 09 Apr 2003 10:18:04


Sybren Stuvel spilled his alphabet soup on the floor,
and the letters spelled:

Quote:> Franoculator enlightened us with:
>> mkdir /mnt/backup/$BU_DATE
>> cp -Rf /mnt/backup/* /home/backup/$BU_DATE/

> You create a new directory, and then you copy all files from that new
> directory (ergo: no files) to /home/backup/$BU_DATE. I think you got
> some arguments mixed up:

> # cp -Rf /home/backup/* /mnt/backup/$BU_DATE/

> Sybren

Nah, the script is good.  I ended up just dropping vcron, and replaced
with with fcron.  No more problems.  Thanks for the advice though.

--
Matt

"Windows is a commercial OS, you don't like it then don't buy it"
    - Written by a wintroll in COLA on January 22, 2003

 
 
 

1. Fun fun fun! :)

I upgraded xf 4.0 to xf 4.0.1 on my PPC running YDL 1.2 (redhat).  I
wanted the latest and greatest video driver... which seems to be very
nice, so far!!

Well, for anyone about to do this, be warned that the XF86Config file
has incorrect keyboard mappings for G4s, anyway.  You can copy the old
settings from the old config file, and you have to do some tweaking
since the config file format has changed, but I think it will be obvious
to you when you compare the two.

Good luck to anyone else out there who is getting ready to upgrade.  I
also upgraded gnome to helix-gnome last night...  that too was an
adventure.  But thanks to the many helpful people who read this
newsgroup, I was able to get through it!   :)

Thanks!

Mike J.

2. What′s this for a card?

3. fun, fun fun

4. find and xargs mv

5. KIllustrator: fun, fun, fun.

6. Bootup Times ... how long????

7. no at, no cron, no fun at all...

8. Need help with Ethernet board

9. cron.deny and cron.allow files for CRON management

10. Ethernet card fun/APM fun

11. cron and visual cron

12. cron, perl, and signals -- cron spins out of control

13. Why doesn't cron run the lp cron file?