This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 3rd, 2013  |  syntax: Bash  |  size: 0.81 KB  |  views: 136  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #! /bin/sh
  2. # /etc/init.d/ramdisk.sh
  3. #
  4.  
  5. case "$1" in
  6.   start)
  7.     echo "Copying files to ramdisk"
  8.     rsync -av /var/ramdisk-content/ /mnt/ramdisk/
  9.     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched from HD >> /var/log/ramdisk_sync.log
  10.     ;;
  11.   sync)
  12.     echo "Synching files from ramdisk to Harddisk"
  13.     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched to HD >> /var/log/ramdisk_sync.log
  14.     rsync -av --delete --recursive --force /mnt/ramdisk/ /var/ramdisk-content/
  15.     ;;
  16.   stop)
  17.     echo "Synching logfiles from ramdisk to Harddisk"
  18.     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched to HD >> /var/log/ramdisk_sync.log
  19.     rsync -av --delete --recursive --force /mnt/ramdisk/ /var/ramdisk-content/
  20.     ;;
  21.   *)
  22.     echo "Usage: /etc/init.d/ramdisk {start|stop|sync}"
  23.     exit 1
  24.     ;;
  25. esac
  26.  
  27. exit 0
clone this paste RAW Paste Data