Answer the question
In order to leave comments, you need to log in
How to delete old files from Yandex disk?
Hello!
What do I want to do?
I want to backup files, but before uploading a new compressed archive, I need to see how many files are on the disk now and leave 2 out of 3, delete the oldest one, delete it and then upload a new one.
I make such a command on the puff.
system ("curl --user ".$yadisk_email.":".$yadisk_pass." -X PROPFIND -H \"Depth: 1\" https://webdav.yandex.ru/".$yadisc_dir."/");
/backup/src/HTTP/1.1 200 OK2019-11-07T10:40:50ZsrcThu, 07 Nov 2019 10:40:50 GMT/backup/src/document.docxHTTP/1.1 200 OK832727d0122757f5882bdcb02ea09f572019-11-07T10:43:02Zdocument.docxThu, 07 Nov 2019 10:56:18 GMTapplication/vnd.openxmlformats-officedocument.wordprocessingml.document11161string(955) "/backup/src/HTTP/1.1 200 OK2019-11-07T10:40:50ZsrcThu, 07 Nov 2019 10:40:50 GMT/backup/src/document.docxHTTP/1.1 200 OK832727d0122757f5882bdcb02ea09f572019-11-07T10:43:02Zdocument.docxThu, 07 Nov 2019 10:56:18 GMTapplication/vnd.openxmlformats-officedocument.wordprocessingml.document11161"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question