Gardia
July 23, 2015, 8:10pm
1
Hello. When using the NethServer Backup system, is it possible to have it work properly with removing a USB disk? Say for example that it backs up at 4:00 then you remove the drive to take home with you. What would be the best way to accomplish this?
Thanks.
P.S. It’s possible to backup ownCloud directories correct?
vcc
(Vasco)
July 23, 2015, 9:38pm
2
Yes, you can remove the drive.
First you need to unmount and then disconnect the drive
The ownCloud data and MySQL database are included in the backup
Gardia
July 23, 2015, 10:04pm
3
Is there some way to automate the unmount?
mabeleira
(Jose "Martin" Abeleira. AKA Marto)
July 24, 2015, 1:10am
4
add a crontab to run umount at certain time, or after backup finishes
mabeleira
(Jose "Martin" Abeleira. AKA Marto)
July 24, 2015, 1:25am
5
i woudl do it with a cron backup, lets say your disk is /dev/sdb1
df -v | grep /dev/sdb1
if [ $? -eq 0 ]
then
/bin/mount /dev/sdb1 /backup
if [ $? -eq 0 ]
fi
mabeleira
(Jose "Martin" Abeleira. AKA Marto)
July 24, 2015, 1:30am
6
sorry wasnt finished
i woudl do it with a cron backup, lets say your disk is /dev/sdb1
df -v | grep /dev/sdb1
if [ $? -eq 0 ]
then
/bin/mount /dev/sdb1 /backup
if [ $? -eq 0 ]
then
echo "Backup failed couldn’t mount drive"
exit 99
fi
fi
tar -cvf /backup/mybackup.tar --exclude=/dev --exclude=/tmp --exclude=/proc
/
if [ $? -eq 0 ]
then
echo "Backup finished ok"
umount /dev/sdb1
else
echo "Backup failed"
umount /dev/sbd1
fi
you can always improve it add more controls, parameters, test the tar file
after finishing etc.
Backup procedure mount the disk at the beginning and umount it when finished. Don’t worry
1 Like
Gardia
July 30, 2015, 3:59pm
8
I understand. However in this use case the server is headless and I just want to have the usb drive be inserted and removed with more or less automatic mounting/unmounting (when backup is complete etc.). Can the NethServer backup module accommodate that, or a Bash script the best option?
zamboni
(Stefano)
July 30, 2015, 4:36pm
9
@Gardia , IMO Alessio already answered to your question…
if not, please be verbose
mabeleira
(Jose "Martin" Abeleira. AKA Marto)
July 30, 2015, 5:41pm
10
i posted a bash script fro backup which i’m using for my fedora and works
fine. Take a look, if you can’t find it i’ll post it back
Gardia
July 30, 2015, 6:22pm
11
Oh!!! Totally misread that, I apologize.
I though @alefattorini was saying that I had to mount/unmount the disk, not that the backup module does that itself.
1 Like