Date: May 13, 2012.
A RAM disk has the advantage that reading and writing data are extremely fast. In addition, no mechanical wear and tear or noise will occur. These properties make it the ideal storage place for files experiencing intensive read or write actions like databases or files which have to be temporarily saved very often, and also for games.
Since data in RAM are not permanently saved but will disappear when a shutdown or a restart occurs, it is absolutely necessary that important files residing on a RAM disk will be backupped in very short intervals.
RAMDisk offers an easy and comfortable management for a RAM disk and its contents and in addition it can serve as a general backup software for your hard disk. Files can be backupped in intervals as small as 1 second and folders in intervals as small as 1 minute.
Time Machine does an excellent job backing up your data every hour, however, it will not backup open files. RAMDisk will backup open files and also offers the possibility to backup individual files.
RAMDisk has a „Tasks“ menu containing several commands, among them are the commands Backup file and Backup folder. Choosing one of them will bring up three consecutive dialog windows to choose the source and target file/folder and the respective backup interval. In case of backing up a file the time interval has to be given in seconds and for a folder in minutes. RAMDisk will then start a new copy (clone) of itself running in the background that will monitor the source issuing the unix command
periodically. When the source will then differ from the target „rsync“ will make an (incremental) backup. The option „-a“ implies that subfolders are included recursively. Hence, specifying your home directory as source will imply that all files in your home directory will be included in the backup.
The home directory is also the largest directory which can be chosen as source, or more precisely, only sources contained in a writable directory are eligible, since RAMDisk will store a protocol file source.ramdisk in the directory containing the source—in case of the home directory a file Home.ramdisk will be placed in the home directory. These actions can be repeated arbitrarily often, i.e., different files or folders can be backupped. However, you should be aware that a folder backup is done recursively.
|
A backup job will be active as long as the protocol file exists and as long as the RAMDisk clones running in the background will be active, i.e., killing the clones, e.g., selecting a clone in the Activity Monitor (they will appear under the name RAMDisk without icon) and pressing the quit icon will give the opportunity to issue a Quit or a Force Quit command—a Quit will always suffice. However, in the Activity Monitor you won’t be able to specify a particular RAMDisk clone.
|
After a restart previous backup jobs won’t be restarted automatically. Instead you will have to choose the command Restart all backup jobs in HD for the jobs with sources in your hard disk and Restart all backup jobs in Ramdisk for those with sources in the RAM disk which is named „Ramdisk“ by default, see Section 3 for more details.
|
More technical details about the management of the backup jobs can be found in Section 4.
The „Create RAM disk“ command in the Tasks menu will create a RAM disk, named Ramdisk, where you only have to specify its capacity in MB.
|
The capacity of the last RAM Disk created this way will always be stored in
and when, e.g., after a restart, you want to recreate the RAM disk this will achieved by the command Recreate last RAM disk.
Backing up files or folders in your RAM disk follows the same pattern as described in the previous section. However, for backing up the entire RAM disk there is a special command Backup RAM disk which will back up the contents of the RAM disk to the folder
You only have to specify the backup interval in minutes. The recommendation is 60 minutes.
When you have backupped your RAM disk at least once, then, after a restart, and after having used the command Recreate last RAM disk, you can use the command Restore the contents of last RAM disk, and finally Backup last RAM disk, where all required data will be looked up.
Similar to the previous command Restart all backups with sources in HD there exists a command Restart all commands with sources in Ramdisk.
|
The actual backup of the files will be done by the unix binary „rsync“. RAMDisk only controls the backup jobs, i.e., source, target and backup interval and calls „rsync“ periodically. For each backup job a particular clone of RAMDisk is responsible running in the background, i.e., you won’t notice it like a normal application and also cannot quit it like you would normally do.
|
A protocol file, which is a plain text file, contains the following data
Here, period denotes the length of the backup interval in seconds; time stands for the machine time at which the corresponding clone has been created, i.e., it’s a time stamp, and will tell an older clone to quit if the time stamp is no longer correct; BackupFile represents the name of a job specific file in either
or
containing the data period;source;target;time of a backup job which are used by the two commands restarting all backup jobs with sources in the hard disk resp. the RAM disk.
There are also two commands for removing all protocol files in the home directory resp. in the RAM disk, which will terminate any backup job and kill any active clone at the start of the next respective backup.
To increase the performance or to reduce the wear and tear of your hard disk it is desirable to copy certain folders, like caches, to the Ramdisk replacing the original folders by a symbolic link pointing to the copy in the Ramdisk. The menu item „Create symlink for folder“ in the „Tasks“ menu will copy a chosen folder to the Ramdisk, and replace the folder by a symbolic link. Safari’s cache folder
is one of these folders which could be replaced by a symlink.
Note, however, that an action like this should be accompanied by either backing up the whole Ramdisk or that particular folder.
The RAMDisk application runs by default in the foreground where you have access to its menus. The clones are copies, or in unix speak, instances of RAMDisk running in the background. When a RAMDisk clone has been created RAMDisk still behaves like a normal application as long as it is open. As soon as it is has been closed, while clones are still active, it can no longer be restarted normally by double clicking. Instead one has either to kill all clones or use a script to restart RAMDisk.
|
Thus, RAMDisk should never be closed when clones are running, or the script has to be used for restarting it.
An emergency backup of Ramdisk will occur prior to a restart or shutdown provided a scheduled backup, initiated by one of the commands „Backup Ramdisk“ or „Backup last Ramdisk“, is active.
RAMDisk requires Mac OS 10.6 or newer.
RAMDisk in the Mac App Store: RAMDisk
RAMDisk, Flashmode, Pdfselect Pro, Pdfselect, TEX Scripts, TeXOnline
E-mail address: gerhardt@math.uni-heidelberg.de