Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function exiting()
- {
- espeak -v english "$1"
- exit "$2"
- }
- if test -f "$1"; then
- file="$1"
- else
- exiting "Invalid path or the file is missing" 1
- fi
- path_to_parent_directory=$(dirname "$file")
- cd "$path_to_parent_directory" || exiting "Couldn't access the directory!"
- mkdir backup
- file_extension=".${file##*.}"
- current_copy="./backup/current_copy${file_extension}"
- cp "$file" "$current_copy"
- yad --notification --image=archive &
- panel_control_pid=$!
- while ps -p "$panel_control_pid"; do
- if [ "$file" -nt "$current_copy" ]; then
- cp "$current_copy" "./backup/$(date +%y-%m-%d_%H-%M-%S)${file_extension}"
- cp "$file" "$current_copy"
- play -n synth 0.1 sine 220 vol -24dB
- fi
- sleep 3
- done
- exiting "Quitting" 0
Add Comment
Please, Sign In to add comment