NASLite Network Attached Storage

www.serverelements.com
Task-specific simplicity with low hardware requirements.
It is currently Fri Jul 04, 2025 1:43 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Back up BAT
PostPosted: Tue Jul 18, 2006 7:48 pm 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
After being caught out the other day and wasting hours recovering data I wanted to make sure it wouldnt happen again.

Below is a bat file that will back up various folders on your XP machine to your NAS :D

the only thing you need to edit is \\Naslite-2\Disk-3\BACKUP this is the path where the data will go. DUMP-FILES is a folder on my desktop, and i have commented out the outlook backup as i dont use it.

and the bin is a folder on my C:

edit it for your own purpose.

copy and paste the code in to notepad and save as backup.bat

Code:
@echo off
:: variables
set drive=\\Naslite-2\Disk-3\BACKUP
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"

echo ### Backing up Desktop Dump...
%backupcmd% "%USERPROFILE%\Desktop\DUMP-FILES" "%drive%\DUMP-FILES"

echo ### Backing up Favorites...
%backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"

echo ### Backing up email and address book (Outlook Express)...
%backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book" "%drive%\Address Book"
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities" "%drive%\Outlook Express"

::echo ### Backing up email and contacts (MS Outlook)...
::%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook" "%drive%\Outlook"

echo ### Backing up the Registry...
if not exist "%drive%\Registry" mkdir "%drive%\Registry"
if exist "%drive%\Registry\regbackup.reg" del "%drive%\Registry\regbackup.reg"
regedit /e "%drive%\Registry\regbackup.reg"

echo ### Backing up the Bin...
%backupcmd% "C:\Bin" "%drive%\Bin"

:: use below syntax to backup other directories...
:: %backupcmd% "...source directory..." "%drive%\...destination dir..."

echo Backup Complete!
@pause


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 24, 2006 6:53 am 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
This Bat file will copy data from one Nas Hard Disk to another.

Edit this line with your path where your data will go

set drive=\\Naslite-2\disk-2\BACKUP

then alter these lines of the location of folders to be backed up

%backupcmd% "\\Naslite-2\disk-3\BACKUP" "%drive%\BACKUP"

%backupcmd% "\\Naslite-2\disk-3\IMPORTANT DATA" "%drive%\IMPORTANT DATA"

as you can see backup and important data will be copied to disk-2 in to the folder backup

to add more folders to back up copy and paste one section and add and edit.

%backupcmd% "\\Naslite-2\disk-3\another folder" "%drive%\another folder"

Code:
@echo off
:: variables
set drive=\\Naslite-2\disk-2\BACKUP
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

%backupcmd% "\\Naslite-2\disk-3\BACKUP"  "%drive%\BACKUP"

%backupcmd% "\\Naslite-2\disk-3\IMPORTANT DATA"  "%drive%\IMPORTANT DATA"

echo Backup Complete!
@pause


I use this bat file with the one i posted above so as i got a copy on two nas drives, I only use this for small files, like emails etc you could schedule them and have then ran at login or a certain time.

Note it only copies data that has changed so is quick when done a second time.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 12:38 am 
Offline

Joined: Thu Apr 28, 2005 11:40 pm
Posts: 49
just wanted to thank you for this script. I have been manually copying things up to now and this has helped a lot. THANK YOU.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 5:27 am 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
vadim_s,

I am glad someone found it useful. I use it daily. If you go to control panel and schedule task you can add the script there. then it will run when you set it to, i.e. when you login, at a certain time. and just so I dont loose the script i got it in one of the folders that gets backed up.

So myback routine is run the first bat to to back up various folders to the nas then i run the second bat to make a copy on another nas drive. so id have to be pretty unlucky to have my windows machine fail plus two nas drives.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 3:53 pm 
Offline

Joined: Thu Apr 28, 2005 11:40 pm
Posts: 49
I did just that. Its running on all of my computers backing up the data that is needed indvidually from each.

I am going to modify this script to return an error code in case something fails and then I can have it email me to let me know that it did not work.


Top
 Profile  
 
PostPosted: Fri Jul 28, 2006 6:15 pm 
Offline

Joined: Fri Jun 30, 2006 5:44 am
Posts: 21
Hi

You might want to look at this

http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 6:50 pm 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
Thanks for the info, taking a look at right now.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 8:25 pm 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
For some reason I can back up normal files like download folder etc but when i back up my *dbx files and favorites etc it will backup the first time but the second time i get a error

Drafts.dbx

rsync: read error: Connection reset by peer (104)

rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.6/io.c(584)

It totally locks my xp machine for 20 seconds then unlocks and i can use the pc quickly then it locks, also tried the exact same thing on my media pc and i get the same result, my outlook backup works first time then it dont second time round. if i remove oulook and favorites and just my normal download folders it never fails.
i guess its something to do with xp updating the files.

Here is the command i use

Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/Desktop/DUMP-FILES/" "192.168.0.254::Disk-0/DUMP-FILES/"
Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/My Documents/" "192.168.0.254::Disk-0/My Documents/"
Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/Local Settings/Application Data/Identities/{D43979E3-361F-4827-A8E9-59A22FDE7806}/Microsoft/Outlook Express/" "192.168.0.254::Disk-0/Outlook Express/"
Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/Application Data/Microsoft/Address Book/" "192.168.0.254::Disk-0/Address Book/"
Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/Favorites/" "192.168.0.254::Disk-0/Favorites/"
Executing: rsync.exe -v -rlt "/cygdrive/C/bin/" "192.168.0.254::Disk-0/bin/"
Executing: rsync.exe -v -rlt "/cygdrive/C/Documents and Settings/gaiden/Local Settings/Application Data/Identities/{D43979E3-361F-4827-A8E9-59A22FDE7806}/Microsoft/Outlook Express/" "192.168.0.254::Disk-0/Outlook Express/"
Profile 'ed' executed in 10 milliseconds. It ran successfully.

i am running the latest versions of rsync and the cygwin1.dll file.

any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 04, 2006 5:42 pm 
Offline

Joined: Tue Sep 14, 2004 11:18 am
Posts: 70
Location: Giessen, Germany
Hi Gaiden,
did you get anywhere with DeltaCopy? When I run DeltaCopy Client, I enter valid IP for a NASLite 2.01 Server, but when I test the connection, I get an error message. "Unable to establish connection. rsync: failed to connect to (IP): Invalid argument (22)"

Can anyone shed some light, as to what's wrong here?
TIA,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 04, 2006 6:34 pm 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
Hi I have used deltacopy and it saves writing your own scripts. But I have encountered a problem when trying to back up dbx files.
So currently I am using my bat file which is now modified to save a logfile with date and times.

id be interested once you are running rsync if u encounter a problem backing up dbx files.

What i have done is enter a profile name then my nas ip then test connection then the little box to get my disks up. then add profile.

have you enabled your rsync services to RW in the services config menu? and reboot.

also try this with your ip
you should see your drives
rsync 192.168.X.XXX::

Another thing there is a newer verison of rsync the current is 2.6.8


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 05, 2006 4:50 pm 
Offline

Joined: Tue Sep 14, 2004 11:18 am
Posts: 70
Location: Giessen, Germany
Hi Gaiden. I had already tried entering a profile name, but the test connection did not work (see error message above.) Services are enabled. (I don't have any dby files, so I can't try this, even if I get it working)

I tried "rsync 192.168.X.XXX::" in Internet Explorer, at the command prompt and in the MS telnet but am not getting anywhere.
1) How does this work to see my drives?

Maybe I won't get to use this function anyways, as the documentation of cwRsync states: "(it does not support copying files between two remote hosts)".
2) Can anyone confirm this?
(I would be backing up data from a "production-" to a backup-server (both running NL-2)).

3) Is there maybe a work-aroung using the NFS exports, to "fool" rsync?

TIA,


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 05, 2006 5:24 pm 
Offline

Joined: Sun Jul 09, 2006 10:26 am
Posts: 428
Location: UK
the command is rsync youriphere::

let me know how you get on.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 6:25 pm 
Offline

Joined: Tue Sep 14, 2004 11:18 am
Posts: 70
Location: Giessen, Germany
Things are working now. Here are the hickups I had in plain language:
- The command has to by run at the command prompt in WinXP.
- For the command to work, the path has to be included and enclosed with ", i.e. "C:\Program Files\DeltaCopy\rsync.exe" (dah...) :oops:
- NFS exports are not necessary. Although some manuals state, that rsync can't work from remote to remote, in my network, I was able to rsync jsut fine from one mapped network drive (pointing to a drive on NAS01) to a remote drive (residing on NAS02).
- using the latest version of rsync seems to be a good idea to eliminate any possible errors and take advantage of the greatest range of switches.
- when running rsync, really only the cygwin dll and the rsync.exe seem to be necessary (residing in the same directory).

Thanks for your help, :lol:
Thorsten

P.S.: I don't have any dbx files I could test with. I imagine this may have to do with the Outlook file possibly being opened? rsync then cannot access it. There is a free script killp/ killapp/ Killprocess or so (?) I came across in my research somewhere, that could be included in a switch, to first end any open applications. I can look again, if you need it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group