Hello everyone.
I'm trying to backup modified folders (with content), but I don't know how to copy full path.
Explanation :
I'm in my user directory,
I modified DOCUMENTS/FIRST-FOLDER/.../LAST-MODIFIED-FOLDER/file.txt in the last 24 hour.
Here's what I do :
It only copies LAST-MODIFIED-FOLDER in WHERETOBACKUP, it does not recreate the full path (DOCUMENTS/FIRST-FOLDER/.../LAST-MODIFIED-FOLDER/file.txt)
How can I do this ?
I precise, I'm a beginner :-D...
Thank you very much
I'm trying to backup modified folders (with content), but I don't know how to copy full path.
Explanation :
I'm in my user directory,
I modified DOCUMENTS/FIRST-FOLDER/.../LAST-MODIFIED-FOLDER/file.txt in the last 24 hour.
Here's what I do :
$ find . -type d -mtime -1 >backup.txt
$ sed -e 's/^/cp -Rvp /' backup.txt >backup2.txt
$ sed -e 's/$/ WHERETOBACKUP/' backup2.txt >backup3.txt
$ sh <backup3.txt
It only copies LAST-MODIFIED-FOLDER in WHERETOBACKUP, it does not recreate the full path (DOCUMENTS/FIRST-FOLDER/.../LAST-MODIFIED-FOLDER/file.txt)
How can I do this ?
I precise, I'm a beginner :-D...
Thank you very much