D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Automatic Script

 

On 22/08/2020 09:22, Rich Brown wrote:
>
> I can hear the despair when I don't post enough info!
>
> I have a NextCloud server running which is connected to three different computers, 
> two in different locations. So if computer one creates a file and this is uploaded 
> then it will be synced through the whole network. However, this is not a back-up 
> and if I delete the same file it is then deleted across the network! So I have two 
> backup disks in two of the computers, so the script will copy that file into the 
> backup drive. It won't need to delete, overwrite or anything else.
>
> I did wonder about rsync but can it do the above please? I thought it synced?
>
> Thanks
>
> Rich
>
I am still having trouble exactly understanding your use case. Is the
aim to have a point in time snapshot of the directory on, say, a daily
basis?

Rsync would do this quite happily. It provides a lot of options to allow
you to customise what is copied across. Despite having "sync" in the
name it is a one way process, from original to copy. We use something
similar at work to provide daily snapshots. Our version is very quick
and dirty. Rsync has an option to tell it what to do with any files
which are overwritten by the copy; in our case we put them in a separate
directory for the day so we can get files older than the previous day
back if we want to. A more sophisticated version uses hardlnks to create
a full copy of the backup directory for each day (without creating any
"new" files); rsync then overwrites any files which have changed,
forcing a new version to be created on the backup disk. I don't think I
explained that very well but the end result is only the changed files
for each day take up disk space; the unchanged ones are just links to
the original.

You could also have a look at rdiff-backup. This is a more backup
orientated tool that handles all the differences automatically. You run
it to create the backups and update them. You also use the tool to work
out what has changed between backups. As far as I know the actually
backup is still readable by normal linux toolsif you want.

Both these tools can be run from cron to provide an automatic service.

There are also plenty of full strength backup solutions out there that
would also do what you want.

Cheers,

Pete



-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dcglug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq