back up script
Forum » tech / scripts » back up script
Started by: tonytraductortonytraductor
On: 1199993918|%e %b %Y, %H:%M %Z|agohover
Number of posts: 1
rss icon RSS: New posts
Summary:
a script to remind me to back up important files, and execute the back up.
back up script
tonytraductortonytraductor 1199993918|%e %b %Y, %H:%M %Z|agohover

#!/bin/bash

  1. this is a script to back up the files for my business
  2. I put it in my autostart.sh so it comes up when I log into fluxbox
  3. but one could just as well put it in crontab to pop up once a week, or something.

A=$(zenity —entry —title "Back it UP!" —text "It is recommended that you back up your financial data at least once a week. Would you like to back up your files now? Type 'yes' to continue")

if [ $A != yes ]; then

zenity —warning —title Okay —text "Don't forget to do a back up soon!"

end

else

zenity —info —title "Proceed" —text "Back Up will begin now."

  1. I originally wrote this to run on kubuntu, but for Linguas OS, you would use gksu instead of sudo
  2. also, one could use rsync instead of cp -u (to my knowledge, they do about the same thing, copy directories and files from one location to another, but only changing what is new in them).

sudo cp -r -u /path/to/files /path/to/back-up/dir/ | tee >(zenity —title "Copying files to back-up!" —progress —pulsate —auto-close)

sudo cp -r -u /home/username/OmegaT/TMs /path/to/backup/dir | tee >(zenity —title "Copying translation memories to back-up!" —progress —auto-close)

zenity —info —title "COMPLETE" —text "Back-up is now complete."

exit

fi

unfold back up script by tonytraductortonytraductor, 1199993918|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License