Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Backup Script, problem
Robert83
post Nov 29 2004, 10:05 AM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hello,

I'm having HUGE problems here... got a backup script that mounts windows shares and copies stuff from it to the local computer, but if a user turns off his her computer during the copy process my server is screwed...and I cannot kill the cp nor the backup-script proccess and cannot acces /share3/
on which the backups are...

how can one solve this? I really do hope that there is a way to tell mount if the mounted drive fails to umount it or something similiar


Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Termina
post Nov 30 2004, 09:00 AM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



Could I get this script from you? wink.gif

Anyways, I'm not great (or decent) at bash programming, so I'm not sure how intellegent this answer will be...

Might you be able to (on your own, with a stopwatch) calculate how long each transfer usually takes (when no problems occur?). Let's say this is 2 minutes. Can you make a seperate script (that is started when you start the backup script) that, after 5 minutes or so, kill -9 PID of the cp and backup script program?

This way, if there is no problem, nothing is killed. If your script and cp freeze, however, they'll be killed.

That, or there is an easier way.

Next time someone turns off their computer, grab a newspaper, roll it up, and hit the back of their head with it. That or hook up a car batter to the 'Off' button of the computer. >=D


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Robert83
post Dec 1 2004, 03:42 AM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

here it is, not to fancy, but did It myself and it's working.

CODE
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin

renice -10 -p $
mkdir /share3/backup

mkdir /share3/n-tibor
mount -t smbfs -o guest //n-tibor/My' 'Documents /share3/n-tibor
cp -au /share3/n-tibor /share3/backup
umount /share3/n-tibor
rmdir /share3/ntibor

mkdir /share3/backupDVD
tar -czf /share3/backupDVD/backup-gepek.tgz /share3/backup --exclude '*.mp3' --exclude '*.wma'


I was talking in the samba irc room, and a guy told me that it's a samba problem, when the computer is turned off you cant kill cp -au ...and I think cause samba aint time outing imediately and cp is waiting for something to happen...but after 4 hrs cp dies...and samba leaves a mount in the directory like this ?mount (in red) ...you just do a umount mount (without ?) and it's done.

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th October 2017 - 12:02 PM