Failover tmpfs mirroring. Am I doing it right?

Posted by user45286 on Server Fault See other posts from Server Fault or by user45286
Published on 2010-07-17T04:00:26Z Indexed on 2012/11/24 5:08 UTC
Read the original article Hit count: 506

Filed under:
|
|
|

My goal is to have a certain directory to be available as tmpfs. There will be some modifications during server uptime in this dir and those modifications must be synced to non-tmpfs persistent dir on HDD over rsync.

After server boot the latest version from non-tmpfs persistent dir must be moved to tmpfs and rsync syncing to be started.

I'm afraid that rsync will erase non-tmpfs backup if tmpfs dir will be empty..

I'm doing it in this way right now:

  1. create tmpfs partition in /etc/fstab
  2. cat /etc/rc.local (pseudocode)

    delete "tmpfs rsync" cronjob from /var/spool/cron/crontabs if there is any

    cp -r /path/to/non-tmpfs-backup /path/to/tmpfs/dir

    append /var/spool/cron/crontabs with "tmpfs rsync" cronjob

What do you think?

© Server Fault or respective owner

Related posts about cron

Related posts about rsync