(Elementary user)
I have tried making a script that looks for directories older than 24 hours at 'top' level; by that I mean I do not want it to descend into subfolders) it should then move (using a special move binary) the found directories to another location and place them in a folder with the date from yesterday.
Here is my script:
#!/bin/sh
#
cd /path/to/my/folder/to/search/in
#
YESTERDAY=$(date -d "yesterday" '+%Y-%m-%d')
#
find . -maxdepth 1 -mindepth 1 -mtime 1 -type d -exec /usr/etc/appletalk/ksmv {} /target/path/after/moving/$YESTERDAY/ \;
Can anyone confirm, have I understood the flags correctly?
Best regards
I have tried making a script that looks for directories older than 24 hours at 'top' level; by that I mean I do not want it to descend into subfolders) it should then move (using a special move binary) the found directories to another location and place them in a folder with the date from yesterday.
Here is my script:
#!/bin/sh
#
cd /path/to/my/folder/to/search/in
#
YESTERDAY=$(date -d "yesterday" '+%Y-%m-%d')
#
find . -maxdepth 1 -mindepth 1 -mtime 1 -type d -exec /usr/etc/appletalk/ksmv {} /target/path/after/moving/$YESTERDAY/ \;
Can anyone confirm, have I understood the flags correctly?
Best regards