added existing shell scripts
This commit is contained in:
18
collect-videos
Executable file
18
collect-videos
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
src_user="gabi"
|
||||
src_dir="/home/$src_user"
|
||||
dest_user="tikaiz"
|
||||
dest_dir="/home/$dest_user/Videos"
|
||||
file_ext=".mkv"
|
||||
echo "collecting files with extension $file_ext from $src_dir to $dest_dir"
|
||||
echo "Running with sudo"
|
||||
sudo -k
|
||||
sudo find "$src_dir" -maxdepth 1 -type f -name "*$file_ext" -not -name '.*' -execdir sh -c '
|
||||
echo "processing file: $1"
|
||||
mv "$1" "$2"
|
||||
' sh '{}' "$dest_dir" ';'
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "successfully collected files!"
|
||||
else
|
||||
echo "error while collecting files!"
|
||||
fi
|
||||
Reference in New Issue
Block a user