NSLU2-Linux
view · edit · print · history

Optware.Ccollect History

Hide minor edits - Show changes to markup

February 13, 2008, at 08:02 AM by oleo -- crontab fix
Changed line 71 from:
  • 3 * * 7 /opt/bin/ccollect.sh weekly optware
to:

0 3 * * 7 /opt/bin/ccollect.sh weekly optware

June 27, 2007, at 08:06 PM by oleo --
Changed line 69 from:

This could be run within crontab like

to:

This could be run within crontab -e like

June 27, 2007, at 06:56 PM by oleo --
Added lines 58-66:

[optware] Backup lasted: 0:10:36 (h:m:s) Wed Jun 27 18:47:07 UTC 2007 Executing /opt/etc/ccollect/defaults/post_exec ...

  1. !/bin/cat

If you see this content, post_exec was executed. (general post_exec)

Wed Jun 27 18:47:07 UTC 2007 Finished /opt/etc/ccollect/defaults/post_exec. ==> Finished <==

June 27, 2007, at 06:55 PM by oleo --
Added lines 60-64:

This could be run within crontab like

 
* 3 * * 7       /opt/bin/ccollect.sh weekly optware
June 27, 2007, at 06:54 PM by oleo --
Added line 31:
Added lines 33-34:

Self backup creation session would be:

Added line 43:
Added line 45:
June 27, 2007, at 06:29 PM by oleo -- example
Changed line 29 from:

[@ 192.168.1.1::optware

to:

[@ 192.168.1.20::optware

Changed lines 31-32 from:

and symbolic link named destination to backup directory.

to:

and symbolic link named destination to backup directory.

 
root@oleo:/home/root# cd /opt/etc/ccollect/sources
root@oleo:/opt/etc/ccollect/sources# mkdir optware
root@oleo:/opt/etc/ccollect/sources# cd optware
root@oleo:/opt/etc/ccollect/sources/optware# echo "192.168.1.20::optware" > source
root@oleo:/opt/etc/ccollect/sources/optware# mkdir /home/backup/optware
root@oleo:/opt/etc/ccollect/sources/optware# ln -s /home/backup/optware destination

and run manually

root@oleo:/opt/etc/ccollect/sources/optware# cd    
root@oleo:/home/root# ccollect.sh weekly optware
Executing /opt/etc/ccollect/defaults/pre_exec ...
#!/bin/cat

If you see this content, pre_exec was executed.
(general pre_exec, not source dependent)
Finished /opt/etc/ccollect/defaults/pre_exec.
==> ccollect 0.5.2: Beginning backup using interval weekly <==
[optware] Wed Jun 27 18:25:58 UTC 2007 Beginning to backup
[optware] Currently 0 backup(s) exist(s), total keeping 4 backup(s).
...
June 02, 2007, at 06:07 AM by oleo --
Changed lines 126-127 from:
  <Body>Rezervna kopija za Silvano, Eudoro in Pictures se sinhronizira s strežnikom OLEO. Ne ugašaj računalnika, dokler se ne konča sinhronizacija!</Body> 
to:
  <Body>Rezervna kopija za Silvano, Eudoro in Pictures se sinhronizira s strežnikom OLEO. 

Ne ugašaj računalnika, dokler se ne konča sinhronizacija!</Body>

June 02, 2007, at 06:06 AM by oleo -- ssh note
Changed lines 41-42 from:

is thus not needed unless someone does backups over unsecure internet connection.

to:

is thus not needed for backup transport. SSH component can be used for creating ssh tunnel over internet and triggering backup at user logon.

Changed lines 45-48 from:

Wista refuses to install cwRsync server package. Create shortcut and modyfy compatibility mode to Windows XP. Then installation goes through.

Afer service installation edit rsyncd.conf and start Rsync server from My Computer->Manage->services

to:

Wista refuses to install cwRsync server package. Create shortcut and modyfy compatibility mode to Windows XP. Then installation goes through.

Afer service installation edit rsyncd.conf and start Rsync server from My Computer->Manage->services

June 02, 2007, at 06:00 AM by oleo -- Task scheduler for windows.
Changed line 33 from:

Backup windows clients with ccollect

to:

Backup Windows clients with ccollect

Changed line 43 from:

Vista notes

to:

Windows Vista notes

Changed lines 57-135 from:
to:

For backuping Windows machines I suggest to create scheduled task on windows machine that will trigger ccollect at backup machine. For sparselly connected computer it is best that scheduled task is triggered at user logon and delayed for an hour or so. Such "pull" initiated backup cannot be regarded as daily and for that I suggest that backup rotation scheme should be created as logon with simple

 $ cd /opt/etc/ccollect/defaults/intervals/
 cp daily logon

to compensate confusion of two or more logons at one day.

Triggering backup at ccollect machine from Windows can be done with ssh component that comes with cwRsync server install. Use ssh-keygen -t rsa for creating logon key and then add id_rsa.pub key to ccollect machine logon account in $HOME/.ssh/authorized_keys. This will enable Windows machine to initiate ccollect task without entering password. Of course one needs to have ipkg install openssh first.

The following listing shows complete XML file for Windows vista that can be imported into task scheduler:

  <?xml version="1.0" encoding="UTF-16" ?> 
- <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
- <RegistrationInfo>
  <Date>2007-06-01T20:43:04.7073633</Date> 
  <Author>lian\silvana</Author> 
  <Description>Na strežniku OLEO je program ccollect, ki skrbi za sinhronizacijo s programom rsync.</Description> 
  </RegistrationInfo>
- <Triggers>
- <LogonTrigger id="c10bac05-8c4b-4224-a730-bed95e489324">
  <ExecutionTimeLimit>PT8H</ExecutionTimeLimit> 
  <Enabled>true</Enabled> 
  <UserId>lian\silvana</UserId> 
  <Delay>PT1H</Delay> 
  </LogonTrigger>
  </Triggers>
- <Principals>
- <Principal id="Author">
  <UserId>lian\silvana</UserId> 
  <LogonType>InteractiveToken</LogonType> 
  <RunLevel>LeastPrivilege</RunLevel> 
  </Principal>
  </Principals>
- <Settings>
- <IdleSettings>
  <Duration>PT10M</Duration> 
  <WaitTimeout>PT1H</WaitTimeout> 
  <StopOnIdleEnd>true</StopOnIdleEnd> 
  <RestartOnIdle>false</RestartOnIdle> 
  </IdleSettings>
  <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> 
  <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> 
  <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> 
  <AllowHardTerminate>true</AllowHardTerminate> 
  <StartWhenAvailable>false</StartWhenAvailable> 
  <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> 
  <AllowStartOnDemand>true</AllowStartOnDemand> 
  <Enabled>true</Enabled> 
  <Hidden>false</Hidden> 
  <RunOnlyIfIdle>false</RunOnlyIfIdle> 
  <WakeToRun>false</WakeToRun> 
  <ExecutionTimeLimit>P1D</ExecutionTimeLimit> 
  <Priority>7</Priority> 
  </Settings>
- <Actions Context="Author">
- <ShowMessage>
  <Title>Backup se je za&#269;el!</Title> 
  <Body>Rezervna kopija za Silvano, Eudoro in Pictures se sinhronizira s strežnikom OLEO. Ne ugašaj ra&#269;unalnika, dokler se ne kon&#269;a sinhronizacija!</Body> 
  </ShowMessage>
- <Exec>
  <Command>"C:\Program Files\cwRsyncServer\bin\ssh.exe"</Command> 
  <Arguments>admin@oleo nice -20 /opt/bin/ccollect.sh logon silvana eudora pictures</Arguments> 
  </Exec>
- <ShowMessage>
  <Title>Backup kon&#269;an</Title> 
  <Body>Sinhronizacija podatkov na OLEO je uspela.</Body> 
  </ShowMessage>
  </Actions>
  </Task>
June 01, 2007, at 08:08 AM by oleo -- usage notes and caveats
Changed lines 9-10 from:
to:

Simple example

Added lines 24-57:

Verify access from your backup box with rsync hostname::. Module optware should be listed. Try rsync -tvr hostname::optware /tmp/harddisk/backup if it works.

ccolect backup configuration goes under /opt/etc/ccollect/sources directory. Create backup-name directory there and add source file like:

  192.168.1.1::optware 

and symbolic link named destination to backup directory.

Backup windows clients with ccollect

With ccollect it is also possible to backup windows boxes. One needs to install cwRsync server on windows. cwRsync server can be downloaded from sourceforge site.

See cwRsync - Rsync for Windows site for details. I suggest to download only server component. As mentioned before I do not recommend ssh tunnel for rsync backup as this gives additional CPU burden to backup box. When installing cwRsync service, SSH component is thus not needed unless someone does backups over unsecure internet connection.

Vista notes

Wista refuses to install cwRsync server package. Create shortcut and modyfy compatibility mode to Windows XP. Then installation goes through.

Afer service installation edit rsyncd.conf and start Rsync server from My Computer->Manage->services

Windows firewall normally blocks access to TCP port 831 where daemon resides. Use control panel -> Security -> Open port to allow access from backup machine.

Unattended backup

ccollect is intended to do unattended backup through cron service. This means than machine should be available at time given in crontab. If this is not the case then one should assure this with "Wake on Lan" powering machine on. For shutting Windows machine down I suggest LeonDown service.

There is also possibility to initiate backup with ssh command from windows machine to backup box.

June 01, 2007, at 07:13 AM by oleo --
Changed lines 3-22 from:

Follow instructions at ccollect.sh main web site

to:

Follow instructions at ccollect.sh main web site

I suggest using rsync protocol instead of ssh tunnel as this gives less stress to CPU.

On machine that needs to be backed up install rsync and edit rsyncd.conf to allow rsync access from backup server. eg:

[optware]
        path = /opt
        comment = Dodatni paketi
        read only = yes
        hosts allow = 192.168.1.20
        hosts deny = *
June 01, 2007, at 07:05 AM by oleo --
Changed line 3 from:

Follow instructions at http://unix.schottelius.org/ccollect/ ccollect.sh main web site

to:

Follow instructions at ccollect.sh main web site

June 01, 2007, at 06:58 AM by oleo --
Changed line 3 from:

Follow instructions at ccollect.sh main web site

to:

Follow instructions at http://unix.schottelius.org/ccollect/ ccollect.sh main web site

June 01, 2007, at 06:58 AM by oleo --
Changed line 3 from:

Follow instructions at [http://unix.schottelius.org/ccollect/ |ccollect.sh main web site]

to:

Follow instructions at ccollect.sh main web site

June 01, 2007, at 06:54 AM by oleo -- intro
Added lines 1-3:

This shell backup script uses rsync to do "on line" incremental backup of your computers.

Follow instructions at [http://unix.schottelius.org/ccollect/ |ccollect.sh main web site]

view · edit · print · history · Last edited by oleo.
Originally by oleo.
Page last modified on February 13, 2008, at 08:02 AM