You are not logged in.
I would like a solution about how can I do that whenever somebody places something in a specified directory, some daemon immediately sync it to a backup directory, keeping the original tree structure. Not scheduling, but immediately copy, as soon as the original copy ends.
But only on copying. I don't want to delete automatically anything from the backup dir.
I know it looks like a lame question, but I can't find a good solution by myself.
Offline
rsync maybe?
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
if you are using systemd, a systemd path unit may work. This could trigger a service file which in turn runs rsync.
Or something like this with inotify-tools:
inotifywait -r -m -e close_write --format %w%f <directory> | while read f; do
echo $f was written to
<sync $f>
doneI use something similiar to automatically encode video files I put in a specific directory, works quite well.
Offline
incron offers a easy way to configure actions when certain path in filesystem changes. In your incrontab you could do something like
/my/directory/watch IN_MODIFY,IN_CREATE,IN_MOVE,IN_DELETE rsync ...Last edited by aline (2012-07-26 15:35:23)
Offline
That sounds a lot like you want to snoop on someone else ![]()
If you specify your problem better maybe someone might have some experience with it and suggest an appropriate solution, you may want to say if you want to "backup" only text files or all files.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Perhaps look into fsniper?
Offline
That sounds a lot like you want to snoop on someone else
If you specify your problem better maybe someone might have some experience with it and suggest an appropriate solution, you may want to say if you want to "backup" only text files or all files.
Nothing illegal ![]()
I'm a sysadmin at an office. We have a fileserver, from which I do a weekly backup to a portable USB drive. Some days ago I deleted everything from the USB drive as I prepare to do the weekly backup and that very moment I finished the wipe, one of my colleagues accidentally deleted something important from the server. As I wiped the backup a minute ago, there were no backup to restore those files.
That is I want to avoid in the future with this secondary backup.
Perhaps look into fsniper?
I'll look into it, thanks
Last edited by Lenry (2012-07-28 07:05:09)
Offline
Fair enough
I'd say you should probably look into your backup sequence as it seems is what made things fail. I'm no expert but deleting your only backup before you make a new one sounds like a bad idea.
If it was me I would keep some copies local to the file server, say a week's worth of backups, maybe using something like rsnapshot or similar. If you need to clear the external hd before you backup then get another one, then always delete the oldest copy.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Fair enough
I'd say you should probably look into your backup sequence as it seems is what made things fail. I'm no expert but deleting your only backup before you make a new one sounds like a bad idea.
I know, it is, but I have to work with what I have.
If it was me I would keep some copies local to the file server, say a week's worth of backups.
That's exactly what I did at the end of the day ![]()
I made a cron job, that runs an rsync script every night, and create a backup of every new file.
It still needs a little tweaking (it would be great if it magically know what subfolders belongs to one project, and do a new backup of the full project, if anything changes in that, but I'll figure out something), but at least it works, and add some bonus level of safety.
Last edited by Lenry (2012-07-31 07:51:15)
Offline