You are not logged in.
Pages: 1
Well it's almost christmass for you all, i already had sinterklaas in the Netherlands. Wich bought me a nice 1 TB networkattached storage i can conect to this device with samba or ftp. I know want to make a custom backup script ( i don't know i am in the right forum but i am a newbie at this ). I know backups are quite important so i figured out a backup plan every week i want to make a full backup ( with tar) and every 2 days a incremental backup.
I plan to use samba and i have mounted it on /mnt/nas_backup. I want this script to mount this share and make a tar in my home directory and then copy it to the directory of the share
DAY=`date "+%F_%H:%M"`
share="/mnt/nas_backup/BackupP6"
backupmap="/home/jelle"
mount -t cifs //192.168.2.101/myshare /mnt/nas_backup -o username=admin,password=xxxxx
cd /home/jelle/backup
tar cvpzf backupfullP6_$DAY.tgz /home/jelle --exclude=/home/jelle/.mozilla/firefox/*.default/Cache --exclude=/home/jelle/backup --exclude=/home/jelle/.Trash --exclude=/home/jelle/.local/share/Trash/files --exclude=/home/jelle/Muziek --exclude=/home/jelle/Movies
tar cvpzf backupfullP6_$DAY-etc.tgz /etc
tar cvpzf backupfullP6_$DAY-var.trz /var
mv /home/jelle/backupfullP6_Date.tgz share
umount /mnt/nas_backup
Is this a good script, i want to use cron to shedule it to run it every week.
But now i need incremental backups should i use rsync for this?
i have seen this code on the arch wiki
#!/bin/bash
rsync -ar --delete /folder_to_backup/ /location_to_backup/ &> /dev/null
I also own a laptop wich i also want to backup, but it isn't always on my home location, so can i write a script that checks if i am in my network and then makes a backup ?
Offline
Looks pretty good... A few points though...
1. Why create an intermidiate file? Why not just write directly to /mnt/nas_backup?
2. rsync won't recognise your tar backup, so you'll actually be creating 2 backups. One tar'ed and one rsync.
Personally, I use just rsync for my data backups. After the initial backup, it keeps it nice and fast. Especially on my laptop over the wireless network. Here's the command I use:
/bin/date > ~/last_backup.txt
/usr/bin/rsync -av --delete --exclude=.Trash* --exclude=.gvfs --exclude=.smb --exclude=.local/share/Trash --exclude=.mozilla/firefox/*/Cache ~/ rsync://server/BackupData/fukawi2-Desktop/
Makes it easy to restore a single file too. Just a simple copy/paste from the server. Don't have to worry about tar'ing.
I do still use tar though, but only for configuration backups. The script is here:
http://pastebin.com/f23fd09ac
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Looks pretty good... A few points though...
1. Why create an intermidiate file? Why not just write directly to /mnt/nas_backup?
2. rsync won't recognise your tar backup, so you'll actually be creating 2 backups. One tar'ed and one rsync.Personally, I use just rsync for my data backups. After the initial backup, it keeps it nice and fast. Especially on my laptop over the wireless network. Here's the command I use:
/bin/date > ~/last_backup.txt /usr/bin/rsync -av --delete --exclude=.Trash* --exclude=.gvfs --exclude=.smb --exclude=.local/share/Trash --exclude=.mozilla/firefox/*/Cache ~/ rsync://server/BackupData/fukawi2-Desktop/
Makes it easy to restore a single file too. Just a simple copy/paste from the server. Don't have to worry about tar'ing.
I do still use tar though, but only for configuration backups. The script is here:
http://pastebin.com/f23fd09ac
Well i want to make full backups and incremental backups, incremental with rsync and full with tar. But i still want to fix this script to automaticlly backup my laptop when it is in my home network maybe i can compare the gateway.
Offline
Seems like the easiest way to check for your home network is to just try to mount the NAS share. You'll likely not find the 192.168.2.101 IP working on an outside network.
Also, what about some kind of revision control system for doing the backups. That way you would have versions of files that you could go back and recover if necessary. I've never done this but I have always wanted to try.
Offline
The other option to do incrementals would be to psuedo-snapshots using rsync. I've done this before, and it's awesome:
http://www.mikerubel.org/computers/rsync_snapshots/
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
out of curiosity, which disk did you get?
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Lacie NetworkSpace 1 TB it works very well with Linux! , you can use a samba share or use fpt. It's also has a daap-server running, rhythmbox detected that share perfect. Also it has a usb key backup function. I like it very much now i can save all my series i download
Last edited by jelly (2008-12-20 16:36:31)
Offline
Pages: 1