Compare commits
2 Commits
8ffc2dfe32
...
0f118e015e
Author | SHA1 | Date | |
---|---|---|---|
0f118e015e | |||
af93865525 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.bak
|
||||
*.log
|
||||
|
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
||||
# Autogenerated at 26.08.2022 08:21 using ./gen-makefile
|
||||
# Autogenerated at 28.09.2022 07:40 using ./gen-makefile
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
#===============================================
|
||||
|
@ -7,5 +7,5 @@ echo "Installing Canon Pixma MG2500 + ppa..."
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
sudo add-apt-repository ppa:thierry-f/fork-michael-gruz
|
||||
sudo add-apt-repository -y ppa:thierry-f/fork-michael-gruz
|
||||
sudo apt install cnijfilter-mg2500series scangearmp-mg2500series
|
||||
|
@ -7,5 +7,5 @@ echo "Installing grub-customizer (latest)..."
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
|
||||
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer
|
||||
sudo apt install -y --autoremove grub-customizer
|
||||
|
@ -7,5 +7,5 @@ echo "Installing ulauncher (latest) + ppa..."
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
sudo add-apt-repository ppa:agornostal/ulauncher
|
||||
sudo add-apt-repository -y ppa:agornostal/ulauncher
|
||||
sudo apt install -y --autoremove ulauncher
|
||||
|
@ -9,6 +9,6 @@ echo
|
||||
|
||||
sudo dpkg --add-architecture i386
|
||||
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
|
||||
sudo add-apt-repository -y 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
|
||||
sudo apt install -y --autoremove winehq-stable
|
||||
wine --version
|
||||
|
38
tools/inotifywait-cp.sh
Executable file
38
tools/inotifywait-cp.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# My use case:
|
||||
# syncthing synchronizes ALL changes in DCIM directory on my android to PC.
|
||||
# I wanted files to be copied somewhere else on my PC to stay forever, so I
|
||||
# could sort them later and safely free some space on mobile without loss.
|
||||
# Also I wish to have some stupid log with history of such events.
|
||||
|
||||
# inotify-tools package must be installed!
|
||||
|
||||
# CHANGE THIS PARAMETERS to ones you needed
|
||||
dir_src="$HOME/Syncthing/Mobile/Camera"
|
||||
dir_dest="$HOME/some/safe/place"
|
||||
dir_logs="$HOME/inotifywait-cp-logs"
|
||||
regexp="[0-9]{8}_[0-9]{6}.*\.(jpg|mp4|gif)"
|
||||
|
||||
# Arguments description:
|
||||
# --quiet -- print less (only print events)
|
||||
# --monitor -- don't stop after first event (like infinite loop)
|
||||
# --event -- first syncthing creates hidden file to write data into
|
||||
# then renames it according to source file name, so here
|
||||
# we listen to MOVED_TO event to catch final filename
|
||||
# --format %f -- print only filename
|
||||
# --include -- filename regexp to catch event from, ensure your $regexp
|
||||
# is correct or remove line 32 to catch synced ALL files
|
||||
|
||||
mkdir -p "$dir_dest" "$dir_logs"
|
||||
inotifywait \
|
||||
--quiet \
|
||||
--monitor \
|
||||
--event moved_to \
|
||||
--format %f \
|
||||
--include "$regexp" \
|
||||
"$dir_src" \
|
||||
| while read filename; do
|
||||
cp "$dir_src/$filename" "$dir_dest/$filename"
|
||||
echo "[`date '+%H:%M:%S'`] COPIED: $dir_src/$filename => $dir_dest/$filename" \
|
||||
| tee -a "$dir_logs/`date '+%Y%m%d'`.log"
|
||||
done
|
Loading…
Reference in New Issue
Block a user