> I have big problem: I need to automaticaly copy files from Win'pc to
Linux
> server.
I submitted this one to the mailing list awhile back, but I've made some
improvements, so here it is again.
We have cron run a script every night that backs up all the systems (Win and
Unix) to a single tape. Naturally, the tape capacity needs to be large enough
for all the systems involved. The HP 4mm DAT DDS-3 tapes with 12 gb (before
compression) capacity work nicely for us. We also do incrementals on most
of the Unix systems, and avoid making copies of program files on the Win
systems.
Here's the script:
-------------- next part --------------
#! /bin/csh
if ($#argv == 0) then
set fileno = 0
else
set fileno = $1
endif
set SMBC=/usr/local/samba/bin/smbclient
cd /backup
set TAPE=/dev/nrst0
set EXCLUDE=(windows winnt dos xnfs orcadwin MAXPLUS2 emacs OmniX OmniNFSXe \
MSOffice Office wpwin60 Acrobat3 engr wpc20 DMI ATI PAGEMGR KPCMS OPLIMIT \
wpwin60 dell mouse vibra16 teac winmcad win32app acroread acrobat3 \
bsdl pkware ACADR13 DTEXT23 MCVHDL RECYCLED lotus Corel ACER \
MAX2WORK ticd abel3 clipart HPFONTS ORCADWIN ICM98)
# Hosts with pcadmin remote access account
#
#
set hlist = ( drachma kopek masada tohoten shiva peddlerI fujin sappho )
set olist = ( sandra johnf glenn jean peggy paula jim maureen )
set i = 1
while ($i <= $#hlist)
date
echo ping $hlist[$i]
ping $hlist[$i]
if ($status) then
echo email to $olist[$i] for $hlist[$i] not available
/bin/mail -s "Backup for $hlist[$i] failed" $olist[$i] \
< /backup/failed.msg
/bin/mail -s "Backup for $hlist[$i] ($olist[$i]) failed" backuplist\
< /backup/failed.msg
else
echo File ${fileno}: $hlist[$i]
$SMBC \\\\$hlist[$i]\\c "pcadmin" -TcbX 126 $TAPE \
"Program Files" $EXCLUDE >&! $hlist[$i].log
@ fileno = $fileno + 1
endif
@ i++
end