First check whether cron packet is installed on not :
apt-get update && apt-get upgrade
dpkg -l cron
If not installed, then install it using following command
sudo apt-get install cron
Ensure that the cron service is running with the following command:systemctl status cron
To check the active cronjob enter :
crontab -l
To create cronjob :
crontab -e
Let us make a move.sh file to run in cron.
!/bin/bash
mkdir /home/pi/Documents/backup/”$(date +”%d-%m-%Y”)”
find /home/pi/Documents/motion -type f -mtime +1 -exec mv ‘{}’ /home/pi/Documents/backup/$(date +”%d-%m-%Y”)/ \;
link to dowwnload .sh file
Run command for cronjob :
crontab -e
Done. Now cron move all files at 03:08 pm