Skip to content

Commit

Permalink
Added while loop to delete video script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhoads committed Dec 10, 2019
1 parent 0d2038a commit 155fd7f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,24 @@ These scripts are designed to be run as systemd services on linux (the VetSim pc

## The Scripts
### 1. vetsim_delete_old_videos
This script
This script deletes old videos from their default location on the vetsim PC.


#!/bin/bash
#David Rhoads, December 2019
#Script to delete old video files
#Replace /path/to/directory with actual path to video folder. Be sure folder is actually there before running the script
#-mtime checks the time since the last modification of the file
#-type -f tells the program it should look at files
#-delete tells the program to delete the files (surprise :-))

echo "This program deletes files older than a specified date at a specified location."
while true
do
find '/path/to/directory' -mtime +30 -type f -delete
sleep 30
done


### 2. vetsim_copy_video_files
This script copies videos to an external device. This is usefull if you want to store the videos on an external hard drive
8 changes: 6 additions & 2 deletions vetsim_delete_old_videos
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#-mtime checks the time since the last modification of the file
#-type -f tells the program it should look at files
#-delete tells the program to delete the files (surprise :-))
#!/bin/bash

find /path/to/directory -mtime +30 -type f -delete
echo "This program deletes files older than a specified date at a specified location."
while true
do
find '/path/to/directory' -mtime +30 -type f -delete
sleep 30
done

0 comments on commit 155fd7f

Please sign in to comment.