Re: Automatic Backup software for ubuntu server?
Quote:
Originally Posted by
watercooled
Edit /etc/network/interfaces and replace:
With:
Changing any addresses as appropriate, and replace eth0 with your adapter (likely eth0 if you only have 1 adapter).
Then type
to apply the settings without needing to reboot (note this will terminate any active connections).
back home now. first thing i did was to try the above. i however dont get this
Code:
allow-hotplug eth0 inet dhcp
below is the contents of my interfaces file
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
edit: i added the ip address. gatewaya ddress etc like this:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
And recieved an error when trying to apply the enw changes with the networking restart command
Code:
* Reconfiguring network interfaces... /etc/network/interfaces:10: misplaced option
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:10: misplaced option
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]
Re: Automatic Backup software for ubuntu server?
IIRC the syntax correctly, interfaces should be:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.3
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
Re: Automatic Backup software for ubuntu server?
ok cool that seems to work
Re: Automatic Backup software for ubuntu server?
Oops, sorry about that. I should have double-checked that before posting. :(
I\'ll go back and edit it for the benefit of anyone who reads this in future...
Re: Automatic Backup software for ubuntu server?
Cool ok thanks mate
Quote:
Originally Posted by
aidanjt
Yes, exactly. Well it's called mount.cifs now, it's literally a mount helper for mounting SMB shares on Linux's virtual filesystem.
There's also a package called fusesmb which will automatically update a chosen directory with a list of machines currently advertising itself on your Windows network, and list shares you have access to using the SMB username and password you supplied when starting it.
Plenty of options available.
Anyways i tried this fusesmb and having some issues. i have installed it fine and made the appropriate directory and config file on my ubuntu user directory as described here https://help.ubuntu.com/community/FuseSmb
Code:
mkdir ~/.smb
cp /usr/share/doc/fusesmb/examples/fusesmb.conf.ex ~/.smb/fusesmb.conf
chmod 600 ~/.smb/fusesmb.conf
nano ~/.smb/fusesmb.conf
So now, when i being to mount the fusesmb to a directory i just created i.e /windows/networkPC
i get the error below executing this :
Code:
params.c:OpenConfFile() - Unable to open configuration file "/root/.smb/smb.conf":
No such file or directory
params.c:OpenConfFile() - Unable to open configuration file "/root/.smb/smb.conf.append":
No such file or directory
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
Re: Automatic Backup software for ubuntu server?
If there are any files or sub-directories in the specified directories fuse will moan. Although I checked out fusesmb after mentioning it to you and it had other issues. Obviously someone has had a tinker with it and broken it since I last used it a few years ago. :\
Wish that wasn't the case, it would save manual mounting.
Re: Automatic Backup software for ubuntu server?
looks like manual mounting is the way to go!. with that script, what do i save the file as? a simple txt file? .config file?
Also, how do i run this script that was posted in page 1 say, umm once or twice a day automatically?
Re: Automatic Backup software for ubuntu server?
Quote:
Originally Posted by
j.o.s.h.1408
looks like manual mounting is the way to go!. with that script, what do i save the file as? a simple txt file? .config file?
Also, how do i run this script that was posted in page 1 say, umm once or twice a day automatically?
save it as filename.sh and you can run it as a scheduled job using cron.
Re: Automatic Backup software for ubuntu server?
Yeah, it doesn't matter about the file extension, the important thing is that it has +x permissions for the user running it, the octet '755' is the standard affair for executables.
Re: Automatic Backup software for ubuntu server?
Hi, How do i run it as chrom job? i got the script saved as backupNetworkFiles.sh in /etc
Re: Automatic Backup software for ubuntu server?
crontab -e opens your cron table in your chosen editor.
A simple entry would just be:
Code:
@daily /etc/backupNetworkFiles.sh
You can also suppress output from being emailed to you by piping output to null:
Code:
@daily /etc/backupNetworkFiles.sh >/dev/null 2>&1
Re: Automatic Backup software for ubuntu server?
Ok thanks.i made changes to the cron job and i set it up to start from 20:30 tonight. i then looked at the destination folder and its blank?
do i need to launch the cron job to start the service?
Re: Automatic Backup software for ubuntu server?
Have you marked the script as executable?
Re: Automatic Backup software for ubuntu server?
sudo chmod 755 backupPictures.sh ?
Re: Automatic Backup software for ubuntu server?
Doesnt seem to work myscript. is there a log file for cron that i can view?:
here is my script:
Code:
#!/bin/bash
for i in /windows/NetworkDirectories/MSHOME/-I7-PC/Pictures/*; do
rsync -a --delete /windows/mediahdd1/backupTest/sync ${i}/
done
Here is my cron file
Code:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
40 * * * * /etc/backupPictures.sh
Re: Automatic Backup software for ubuntu server?
Have you tried running your script manually first to make sure it's working as intended?
Oh, and you'll probably want your script looking more like this:
Code:
#!/bin/bash
for i in /windows/NetworkDirectories/MSHOME/*; do
rsync -a --delete ${i}/Pictures/ /windows/mediahdd1/backupTest/sync/
done