SHARE
TWEET

Untitled

a guest Jan 3rd, 2013 143 Never
  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
RAW Paste Data
Top