last day (15 days later) » 

12:21
@danny can you join me here?
Hi ted
Hi, so, can you show me the exact script you used?
Just paste it here and click on the "fixed font" button
@Danny
Ok
#!/usr/bin/env bash

## Create a file to compare against.
tmp=$(mktemp)
touch -d "September 8" "$tmp"

## Define the source and target parent directories
source=/home/danny/Desktop/warda_alshifa/
target=/home/danny/Desktop/copy_files/

## move to the source directory
cd "$source"

## Find the files that were modified more recently than $tmp and copy them
find ./ -type f -newer "$tmp" -printf "%h %p\0" |
    while IFS= read -rd '' path file; do
        mkdir -p "$target"/"$path"
        echo "$file" "$target"/"$path"
OK, hang on.
I have taken the output by redirecting it to txt file will that help
12:32
The errors? Sure, show me.
I mean it has the list of all the files processed
How can I share the txt
??
@Danny Oh, no that should be OK. Give me a sec, I want to see if I'll get the same error.
ok
OK, no, that should have worked.
Can you show me the first few lines of the output?
@Danny
ok
I ill copy paste
/home/danny/Desktop/copy_files//./survey/includes ./survey/includes/class_survey_view.php
/home/danny/Desktop/copy_files//./survey/includes ./survey/includes/class_survey_general.php
/home/danny/Desktop/copy_files//./survey/includes ./survey/includes/class_survey_master.php
/home/danny/Desktop/copy_files//./survey/php ./survey/php/ajax_detailed_result_graph.php
/home/danny/Desktop/copy_files//./survey/php ./survey/php/ajax_question_master.php
/home/danny/Desktop/copy_files//./survey/php ./survey/php/ajax_options_master.php
there are like 4500 entries
12:39
@Danny hang on, are the originals in copy_files or in warda_alshifa?
in warda_alshifa
copy_files is the place where I want the nw folders to be created
OK
OK, one of the variables remains empty and I'm not sure which one. Try changing the script to this:
find ./ -type f -newer "$tmp" -printf "%h %p\0" |
    while read -rd '' path file; do
        echo "F:$file T:$target P:$path"
    done
I just want to be sure which of the 3 variables is the problem. You don't need to let it run for long, just show me the first few lines.
Here u go
F:./survey/includes/class_survey_view.php T:/home/danny/Desktop/copy_files/ P:./survey/includes
F:./survey/includes/class_survey_general.php T:/home/danny/Desktop/copy_files/ P:./survey/includes
F:./survey/includes/class_survey_master.php T:/home/danny/Desktop/copy_files/ P:./survey/includes
F:./survey/php/ajax_detailed_result_graph.php T:/home/danny/Desktop/copy_files/ P:./survey/php
F:./survey/php/ajax_question_master.php T:/home/danny/Desktop/copy_files/ P:./survey/php
But, that seems to work perfectly!
Weren't the files actually copied when you tried?
I though the same
nope i was getting the cp: cannot stat ‘’: No such file or directory
12:46
I'm guessing that only happened for some of them. Were no directories created?
no I have double checked
Sorry
wait a min
I have directories created but no files in it
Ah, OK, that's different.
Dammit, @Danny, I'm sorry but I have to go. I can have another try at this later. In the meantime, you could try asking in the main chat room someone there might be able to help.
I'll @ ping you when I get back and have the time. :(
Fine thanks for the Time
 
4 hours later…
16:31
@Danny you now have various answers, the best one by far being Gilles's (as usual). I also added another method to mine. Let me know if you still need help.
16:49
havent checked Gilles answer
The last post of yours I got to try and it worked as expected
I am out of office now will give everything a try and comment tomorrow
thanks a lot
You're very welcome.

last day (15 days later) »