Open main menu

Changes

5,436 bytes added ,  15:00, 6 January 2017
adds info about backing up my laptop home directory from the QNAP
locally on the network, it uses DHCP, with two ethernet nics (dual-homed)
Access it via your network share (at 192.168.1.4 or 192.168.1.5) or externally at http://cloud.equality-tech.com
 
== Backups ==
 
{{ambox|
|text = There is no bash history on QNAP. All 'history' is lost after each session!}}
 
{{ambox|
|text = All content should go into user directories because subsequent upgrades could wipe data elsewhere. In other words, do NOT create a /backup folder!
 
<code>/share/CACHEDEV1_DATA/homes/greg/backups/</code> is the root for backups storage
}}
 
I've created rsync scripts in the 'admin' users home directory which will backup <kbd>eqt</kbd> and <kbd>greg-laptop</kbd> nb: greg-laptop is ONLY the ''home'' directory, not the full disk.
 
There is also a Duplicity script in /share/CACHEDEV1_DATA/homes/greg/backups/backup_home_to_qnap_san.sh but that's '''not tested/operational'''
== Operating System ==
Under the covers, the QNAP is a Linux box, so if you want to reset someones password, you can just use the <code>passwd</code> command as usual.
== NAS Report ==Here is a script which generates a script, and then runs it. Not sure why it's not just a plain script, but hey it's a neat trick. If you want to just use the script it generates, see /tmp/nasreport after invoking this.<code>cat ./nas_report.sh </code><source lang="bash">#!/bin/shrm -f /tmp/nasreporttouch /tmp/nasreportchmod +x /tmp/nasreportcat <<EOF >>/tmp/nasreport#!/bin/sh## NAS Report by Patrick Wilson# see: http://forum.qnap.com/viewtopic.php?f=185&t=82260#p366188## echo "*********************"echo "** QNAP NAS Report **"echo "*********************"echo " "echo "NAS Model: \$(getsysinfo model)"echo "Firmware: \$(getcfg system version) Build \$(getcfg system 'Build Number')"echo "System Name: \$(/bin/hostname)"echo "Workgroup: \$(getcfg system workgroup)"echo "Base Directory: \$(dirname \$(getcfg -f /etc/config/smb.conf Public path))"echo "NAS IP address: \$(ifconfig \$(getcfg network 'Default GW Device') | grep addr: | awk '{ print \$2 }' | cut -d: -f2)"echo " " echo "Default Gateway Device: \$(getcfg network 'Default GW Device')" echo " "ifconfig \$(getcfg network 'Default GW Device') | grep -v HWaddrecho " "echo -n "DNS Nameserver(s):" cat /etc/resolv.conf | grep nameserver | cut -d' ' -f2echo " "echo " "echo "HDD Information:"echo " "alpha='abcdefghijklmnopqrstuvwxyz'drives=\$(getcfg Storage 'Disk Drive Number')for ((i=1;i<=drives;++i)) ; do echo -n "HDD\$i -" if [ ! -b /dev/sd\${alpha:\$i-1:1} ] ; then echo "Drive absent" else hdparm -i /dev/sd\${alpha:\$i-1:1} | grep "Model" echo " " parted /dev/sd\${alpha:\$i-1:1} print echo " " /sbin/get_hd_smartinfo -d \$i echo " " fidoneecho "Volume Status"echo " "mdadm -D /dev/md0 /dev/md1 2>/dev/nullecho " "cat /proc/mdstatecho " "echo "Disk Space:"echo " "df -h | grep -v qpkgecho " "echo "Mount Status:" echo " "mount | grep -v qpkgecho " "echo "Contents of \$(dirname \$(getcfg -f /etc/config/smb.conf Public path)):"echo " "ls -lF \$(dirname \$(getcfg -f /etc/config/smb.conf Public path))/echo " "echo "Windows Shares:" echo " "for i in \$(grep \] /etc/config/smb.conf | sed 's/^\[//g' | sed 's/\]//g' | grep -v global) ;do echo -n "\$i:" testparm -s -l --section-name="\$i" --parameter-name=path 2>/dev/null doneecho " "echo "QNAP Media Scanner / Transcoder processes running: "echo " " /bin/ps | grep medialibrary | grep -v grepecho " " echo -n "MediaLibrary Configuration file: " ls -alF /etc/config/medialibrary.confecho " " echo "/etc/config/medialibrary.conf:"cat /etc/config/medialibrary.confecho " "echo "iTunes Music Store: \$(getcfg -f /etc/config/mt-daapd.conf general mp3_dir)"echo " "echo "Memory Information:" echo " "free | grep -v cache:echo " "echo "NASReport completed on \$(date +'%Y-%m-%d %T') (\$0) "echo " "EOFsleep 2clear/tmp/nasreport</source> == Utilities ==The NAS is not a full linux box. It only comes with a limited subset of commands, and some of those are provided by [https://busybox.net BusyBox]. To see the output below, just run the <code>busybox</code> command.<pre>BusyBox v1.01 (2016.05.31-18:24+0000) multi-call binary Usage: busybox [function] [arguments]... or: [function] [arguments]...  BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as! Currently defined functions: [, addgroup, adduser, ash, awk, basename, bunzip2, busybox, bzcat, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, df, dirname, dmesg, dos2unix, du, echo, egrep, env, expr, false, fdisk, fgrep, find, free, getty, grep, gunzip, gzip, halt, head, hexdump, hostname, hwclock, id, ifconfig, init, insmod, install, ip, kill, killall, klogd, linuxrc, ln, logger, login, ls, lsmod, md5sum, mkdir, mknod, mktemp, modprobe, more, mount, mv, nameif, netstat, nslookup, openvt, passwd, pidof, ping, ping6, pivot_root, poweroff, ps, pwd, rdate, readlink, reboot, renice, reset, rm, rmdir, rmmod, route, sed, sh, sha1sum, sleep, sort, strings, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch, tr, traceroute, true, tty, umount, uname, uniq, unix2dos, unzip, uptime, usleep, vi, wc, wget, which, whoami, xargs, yes, zcat</pre> There are also a number of commands which are NOT provided by busybox.* <code>ls -al /mnt/HDA_ROOT/usr/bin |grep -v busybox</code>* <code>ls -al /mnt/HDA_ROOT/usr/sbin </code> [[Category:Company]] [[Category:Cloud]] [[Category:Network]] [[Category:NAS]] [[Category:Storage]] [[Category:Server]] [[Category:Backups]]
4,558

edits