added existing shell scripts

This commit is contained in:
2026-01-25 00:31:36 +01:00
parent da393deb38
commit bc6295830d
8 changed files with 49 additions and 0 deletions

18
collect-videos Executable file
View 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