Mount share at boot
![](https://tomtechproductions.be/wp-content/uploads/2020/11/image-3-1024x299.png)
Save credentials at a local place where only you have rights
![](https://tomtechproductions.be/wp-content/uploads/2020/11/image-4.png)
Install cifs-utils
sudo apt-get install cifs-utils
Create directory
sudo mkdir -p /mnt/srv-ttp-nas
Software and hardware
Mount share at boot
Save credentials at a local place where only you have rights
Install cifs-utils
sudo apt-get install cifs-utils
Create directory
sudo mkdir -p /mnt/srv-ttp-nas
An easy way to backup files to a local share
The example backup’s the files from the /var/www/html directory
#change to website folders
cd /var/www/html/
#find all subsites
for D in *; do
if [ -d "${D}" ]; then
echo "Generating backup for $D > " `date +%Y-%m-%d_%H-%M-%S`-${D} # your processing here
tar -zcvf "/mnt/srv-ttp-nas/server/"`date +%Y-%m-%d_%H-%M-%S`-${D}.tar.gz ${D}
fi
done
#remove stale files
find /mnt/srv-ttp-nas/server/* -mtime +14 -exec rm {} \;
Add crontab to run backup every night at 3
sudo crontab -e
0 3 * * * /home/tom/backup_files.sh
Preview of data on share