Homerubackup



  1. Homebackupsystem.biz
  2. Home Backup Power Options
Hi everyone,
I have a fairly limited knowledge of linux and am having an unusual problem. I am trying to use cron to schedule automatic updates of my dat files by logging into McAfee's ftp server and downloading them. I am trying to do this by using a script that I got from the McAfee site. The script contains two parts. One is the .netrc file which contains login details and which I place in the root home directory. The other is a script called update.sh which contains the commands for logging into the ftp server, checking for new dats and updating them if available.
What is unusual about my problem is that, if I am logged in as root, I can manually run the update.sh script and it works fine. However, when I schedule the script to run by placing it in /etc/cron.daily it does not work. The following are parts of the messages which are mailed to root on a daily basis:
login failed.
Name (ftp.nai.com:root): /etc/cron.daily/update.sh: line 31: [: *.ta: integer expression expected
tar: dat-*tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
I think the important part of the message is the 'login failed' bit. The rest is simply due to the fact that the script cannot get to the dat files (due to the failed login obviously).
Because the script works when I run it manually I think it might have something to do with the fact that the .netrc file is inacessable when run using cron. I find this odd though as cron runs as root.
Does anybody have any ideas?
Thanks in advance

While interning at Honeywell, I found this small problem that I had to solve. We arent allowed to move flash drives around since they are quite a security risk to computers running Windows XP, and if you want to backup your files between a home computer and a work computer, there is really no better way than a flash drive. Given that we couldnt use them though, I had to come up with a clean solution to the probem. I tried taking differential backups with 7zip which does a pretty great job at this, bu the problem is that its “differential” is based on timestamps. The home computer runs Linux and the Office one Windows. For some weird reason, the timestamps on windows are of different precision than those on linux, so basically, the same file modified at the same time looks different to 7zip on a windows box and a linux box.

Homebackupsystem.biz

Windows 10’s File History is an easy way to get started with backing up your personal files since it comes built-in to your system. File History takes snapshots of your files as you go. UNICOM® Global consists of more than 50 corporate entities encompassing a wide range of businesses including Mergers and Acquisitions (M&A), Real Estate Development, Business and Financial Services and a range of Information Technology (IT) Divisions.

Homebackupsystem.biz

I had to come up with some kind of solution for this, so I wrote the following python scripts. One is for backing up a custom folder (say Project) and the other is for restoring the backup on another machine. These scripts take an md5 sum of the contents of the files, so timestamps dont matter.

The usage is simple. Just copy these scripts to the folder which contains the folder you want to backup. For example, If you want to backup D:Games , just copy the scripts to D: . Now edit the scripts and change the line :-

dir_backup=”Directory” to

dir_backup=”Your Folder Name”

In the above example, that would be :-

dir_backup=”Games”

HomerubackupHomerubackup

Now youre good to go. Just double click the scripts (in windows) or run the scripts from the terminal (in linux) to run the backup. When you first backup, some files will be created. Just take the scripts to some other computer and copy delta.7z and remove.txt to the same directory, and run the restore script on it. This would generate the folder you backed up in the same directory as the scripts.

From here on, you just need to run backup.py on one machine and copy the 2 mentioned files to the other and run restore.py. The scripts will make sure that everything is up to date between the folders.

As an example, suppose you have a home computer and an office computer and youre trying to backup the folder “Project”(assume we begin at home),

Run backup.py at home

Mail yourself the delta.7z and the remove.txt

Homerubackup

Copy the scripts and the 2 files to some directory on the office comp.

Run restore.py on the office comp.

Make changes to the Project folder at office

Run backup.py at office

Mail delta.7z and remove.txt to home comp.

Copy (and replace) these files into the directory where the scripts are located.

Run restore.py

And so on…

Home Backup Power Options

Do comment if you have trouble understanding this!