(Elementary user)
Good day,
I would like to make directories available for download for 24hours and then move them to another location, inside a subfolder folder with 'yesterday's' date. I would like to use a script and the crontab:
For example - here is the path to my download area:
/raid/downloads/ABC
/raid/downloads/TUV
/raid/downloads/XYZ
Here is the target path for the moved directories:
/raid/legacy_data/DATE FROM YESTERDAY/ABC
/raid/legacy_data/DATE FROM YESTERDAY/TUV
/raid/legacy_data/DATE FROM YESTERDAY/XYZ
Here is my unfinished script:
find . -maxdepth 1 -mtime 1 -name '*' -exec mv {} /raid/legacy_data/DATE FROM YESTERDAY/ \;
Can anyone help me solve the 'date' part of my script?
Best regards
Good day,
I would like to make directories available for download for 24hours and then move them to another location, inside a subfolder folder with 'yesterday's' date. I would like to use a script and the crontab:
For example - here is the path to my download area:
/raid/downloads/ABC
/raid/downloads/TUV
/raid/downloads/XYZ
Here is the target path for the moved directories:
/raid/legacy_data/DATE FROM YESTERDAY/ABC
/raid/legacy_data/DATE FROM YESTERDAY/TUV
/raid/legacy_data/DATE FROM YESTERDAY/XYZ
Here is my unfinished script:
find . -maxdepth 1 -mtime 1 -name '*' -exec mv {} /raid/legacy_data/DATE FROM YESTERDAY/ \;
Can anyone help me solve the 'date' part of my script?
Best regards