MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 13 as of 2023-10-12 21:24:37
  • SambaShare

Samba share

Samba3 by example

  • https://www.samba.org/

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

  • https://www.samba.org/samba/docs/Samba3-ByExample.pdf

  • https://www.samba.org/samba/docs/using_samba/toc.html

  • https://www.samba.org/samba/docs/old/Samba3-ByExample/

Mount samba share on CentOS 6.3

Adapted from http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-samba-connect-share.html

   1 yum install cifs-utils
   2 mount -t cifs -o username=userx,password=passwordx //<servername>/<sharename> /mnt/point/

Add entry to /etc/fstab:

   1 //<servername>/<sharename> /mnt/point/ cifs  username=userx,password=passwordx,_netdev   0 0

Backup all files

File backup.sh:

   1 #!/bin/bash
   2 logfile=/mnt/point/backups`date '+%F'`.log
   3 datex=`date '+%FT%T'`
   4 hostx=`hostname`
   5 backfile=/mnt/point/"$hostx"_backup.tar.gz
   6 
   7 echo "$datex $hostx Log file: $logfile" >> $logfile
   8 echo "$datex $hostx Executing backup on /mnt/point" >> $logfile
   9 cd /
  10 rm $backfile
  11 echo "$datex $hostx Removed $backfile" >> $logfile
  12 tar cpzf $backfile --exclude=/proc --exclude=/dev --exclude=/media --exclude=/mnt --exclude=/lost+found  /  >> $logfile
  13 datex=`date '+%FT%T'`
  14 echo "$datex $hostx Ended backup on /mnt/point" >> $logfile

Add a crontab entry like @daily /home/userx/backup.sh.

smbclient Copy files recursively to share

   1 smbclient -U userx //192.168.1.1/c$ -c 'cd folderx;recurse;prompt;mput *'

Raspbian samba share

   1 sudo apt install samba
   2 netstat -at -n | grep 139
   3 sudo service --status-all
   4 sudo service smbd restart
   5 sudo apt install smbclient cifs-utils
   6 mkdir -p /tmp/shared
   7 chown -Rh nobody:nogroup /tmp/shared
   8 smbclient --list xyz.bitarus.mooo.com --no-pass
   9 cd /etc/samba sudo cp smb.conf smb.conf.orig
  10 nano /etc/samba/smb.conf
  11 sudo service smbd restart
  12 testparm # test smb.conf
  13 smbclient  //xyz.bitarus.mooo.com/shared --no-pass

/etc/samba/smb.conf

   1 [global]
   2    workgroup = Bitarus@Fundao
   3    dns proxy = no
   4    log file = /var/log/samba/log.%m
   5    loglevel = 1
   6    max log size = 1000
   7    panic action = /usr/share/samba/panic-action %d
   8    server role = standalone server
   9    passdb backend = tdbsam
  10    obey pam restrictions = yes
  11    unix password sync = yes
  12    passwd program = /usr/bin/passwd %u
  13    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  14    pam password change = yes
  15    map to guest = bad user
  16    usershare allow guests = yes
  17    guest account = nobody
  18    # chown -Rh nobody:nogroup /tmp/shared
  19 
  20 [shared]
  21    path = /tmp/shared
  22    read only = no
  23    guest ok = yes
  24    writable = yes
  25    browsable = yes
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01