Last active
October 24, 2021 04:01
-
-
Save mohakshah/e0b8401b656b211796cf6faf41442fab to your computer and use it in GitHub Desktop.
pre-run and post-run bash scripts for duplicati that manage a ramdisk based tempdir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# remove the ramdisk to free up the ram | |
diskutil eject $DUPLICATI__tempdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Origianl script from https://superuser.com/a/457376 | |
# set the size of ramdisk here | |
ramfs_size_mb=1024 | |
mount_point=$(mktemp -d -t duplicati-ramdisk) | |
ramfs_size_sectors=$(( ${ramfs_size_mb} * 1024 * 1024 / 512 )) | |
ramdisk_dev=`hdid -nomount ram://${ramfs_size_sectors}` | |
newfs_hfs -v 'duplicati tmpfs' ${ramdisk_dev} || exit $? | |
mkdir -p ${mount_point} | |
# remove "nobrowse" from options if you want to see the mounted ramdisk in the Finder sidebar | |
mount -o noatime,nobrowse -t hfs ${ramdisk_dev} ${mount_point} || exit $? | |
echo "--tempdir=${mount_point}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment