SMBTAR(1)

πŸ’– SMBTAR(1) πŸ’–

okay bestie, sit DOWN, because this is smbtar from the User Commands section of the manual (section 1, for the record), and it's lowkey one of the most iconic little gremlins in the whole Samba family πŸŽ€


✨ NAME ✨

smbtar β€” shell script for backing up SMB/CIFS shares directly to UNIX tape drives


🌈 SYNOPSIS 🌈

smbtar [-r] [-i] [-a] [-v] {-s server} [-p password] [-x services] [-X]
 [-N filename] [-b blocksize] [-d directory] [-l loglevel] [-u user]
 [-t tape] {filenames}

πŸ¦‹ DESCRIPTION πŸ¦‹

This tool is part of the samba(7) suite. Periodt. πŸ’…

smbtar is a very small shell script sitting on top of smbclient(1), and what it does is dump SMB shares directly to tape. Like, no middleman, no drama, straight to the tape. She's tiny but she's doing the MOST. πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • -s server β€” the SMB/CIFS server that the share lives on. You gotta tell her where to go, bestie, she's not psychic. πŸ—ΊοΈ
  • -x service β€” the share name on the server to connect to. The default is "backup". (yes, with the quotes, she's fancy like that)
  • -X β€” exclude mode, babes. Excludes filenames... from the tar create or restore. Not me being like "no thanks to those files specifically" πŸ™ˆ
  • -d directory β€” change to an initial directory before restoring / backing up files. A lil "cd first, ask questions later" moment. πŸšͺ
  • -v β€” verbose mode. She will yap. And honestly? Let her. πŸ—£οΈ
  • -p password β€” the password to use to access a share. Default: none. (and yes the caveats below have OPINIONS about this, keep reading πŸ‘€)
  • -u user β€” the user id to connect as. Default: the UNIX login name. Slay, you're already logged in. πŸ’œ
  • -a β€” reset DOS archive bit mode, to indicate the file has been archived. Little bookkeeping queen. βœ…
  • -t tape β€” tape device. May be a regular file or a tape device. Default: the $TAPE environmental variable; if that's not set, a file called tar.out. 🎞️
  • -b blocksize β€” blocking factor. Defaults to 20. See tar(1) for a fuller explanation, because she is NOT re-explaining that whole thing here. πŸ’€
  • -N filename β€” backup only files newer than filename. Could be used (for example) on a log file to implement incremental backups. Iconic little time-travel trick. ⏰
  • -i β€” incremental mode; tar files are only backed up if they have the archive bit set. The archive bit is reset after each file is read. So she checks, she grabs, she resets. Main character energy. πŸ”₯
  • -r β€” restore. Files are restored to the share from the tar file. The un-backup. The remix. πŸ”„
  • -l log level β€” log (debug) level. Corresponds to the -d flag of smbclient(1). Turn the volume up or down on the debugging, your call. 🎚️

🌸 ENVIRONMENT VARIABLES 🌸

The $TAPE variable specifies the default tape device to write to. May be overridden with the -t option. So $TAPE is like the default fit, and -t is the outfit change. πŸ‘—


πŸ’€ BUGS πŸ’€

The smbtar script has different options from ordinary tar and from smbclient's tar command. So like... do NOT assume she works like her cousins, she is her own girl and her flags are her own flags. Not me accidentally typing tar flags into this and getting humbled. πŸ™ˆ


⚠️ CAVEATS ⚠️

Sites that are more careful about security may not like the way the script handles PC passwords. Bestie. Listen to me. This is a real one.

Backup and restore work on entire shares; should work on file lists.

smbtar works best with GNU tar and may not work well with other versions. So if you're out here with a non-GNU tar, temper your expectations, fr fr. 🫢


πŸ” DIAGNOSTICS πŸ”

See the DIAGNOSTICS section for the smbclient(1) command. She's not repeating herself, go read the girl's page. πŸ“–


⭐ VERSION ⭐

This man page is part of version 4.24.7 of the Samba suite. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘


🧚 AUTHOR 🧚

The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. A whole community, a whole vibe. 🌈

Ricky Poulten wrote the tar extension and this man page. The smbtar script was heavily rewritten and improved by Martin Kraemer. Many thanks to everyone who suggested extensions, improvements, bug fixes, etc. The man page sources were converted to YODL format (another excellent piece of Open Source software, available at ftp://ftp.icce.rug.nl/pub/unix/) and updated for the Samba 2.0 release by Jeremy Allison. The conversion to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.


and that's the whole page, bestie!! this was Samba 4.24.7, dated 09/09/2026, and she was compiled and formatted by the Samba Team for your reading pleasure. go back up your share and stay hydrated πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά
πŸ“¦ where this page comes from