[LUGOS] smbclient

Nejc Skoberne nejc at skoberne.net
Thu Oct 20 09:53:14 CEST 2005


> Pišem eno shell skripto, ki mi bo avtomatično distribuirala neke 
> datoteke iz linuxa na win XP mašine:
> 
> /usr/bin/smbclient //winsrv1/files -U winuser1/password1-c "prompt; mput 
> *.*;" >> smb_prenos.log 2>&1
> 
> Saj deluje, ampak problem je, da se ne ohrani pravi datum datoteke.
> Ali obstaja kakšen parameter, da bi se datum datotek ohranil?

Jaz bi šel stvar "smbmount-ati", tako da potem bi čas ohranil.
Torej paste ene takšne moje "backup" datoteke (na FreeBSDju, treba bi bilo zadevo
malce prilagoditi):

#!/usr/local/bin/bash

/usr/sbin/mount_smbfs -I 192.168.1.1 -W WORKGROUP //user at SERVER/Backup /mnt/server

tar -cpjv -f /mnt/server/Backup/backup-`date | cut -c 5-10 | gsed -e s/ //g`.tar.bz2 `cat /usr/local/etc/backup.list`
find /mnt/server/Backup ! -mtime -3 | xargs rm 1> /dev/null 2> /dev/null

/sbin/umount /mnt/server

LP, Nejc


More information about the lugos-list mailing list