Now Fixed remote direct file server not deleting files

stewart5230

New Member
YetiShare User
Reservo User
Jan 1, 1970
15
0
1
I have setup a remote direct file server and all is working fine but when a user deletes there files its added to the file then action-queue but its not auto deleted

i have setup the cron jobs just fine as all other files are deleted just fine like from the s3 plugin and that

any help thanks
 

stewart5230

New Member
YetiShare User
Reservo User
Jan 1, 1970
15
0
1
Re: Now Fixed remote direct file server not deleting files

Hi taynanbonin6045 i have now got this to work with the help of adam every thing i had setup was working just fine the only thing i did not setup was this part in the file server its self

On Any External File Servers (if you're using 'direct' file server storage)
0 3 * * * php /path/to/your/yetishare/admin/tasks/delete_redundant_files.cron.php >> /dev/null 2>&1
*/5 * * * * php /path/to/your/yetishare/admin/tasks/process_file_queue.cron.php >> /dev/null 2>&1

change /path/to/your/yetishare to the right path of your YetiShare install folder

this is my set up
0 3 * * * php /var/www/html/admin/tasks/delete_redundant_files.cron.php >> /dev/null 2>&1
*/5 * * * * php /var/www/html/admin/tasks/process_file_queue.cron.php >> /dev/null 2>&1

now in your _config.inc.php on the file server its self not the main server one

/* main configuration file for script */
define("_CONFIG_SITE_HOST_URL", "Must be the url of the file server");
define("_CONFIG_SITE_FULL_URL", "Must be the url of the file server");

and
/* set these to the main site host if you're using direct web server uploads/downloads to remote servers */
define("_CONFIG_CORE_SITE_HOST_URL", "Must be the url of the main server");
define("_CONFIG_CORE_SITE_FULL_URL", "Must be the url of the main server");

now in your admin panel under site settings then Site Options look for

How long to keep deleted files for on the server. On delete via the script UI they are moved into /files/_deleted/ then purged after this period. Useful for recovery if needed. Set in minutes. Default 24 hours, so 1440.

and set it to the number 2 for testing


and that's all i did and it started working for me
 

stewart5230

New Member
YetiShare User
Reservo User
Jan 1, 1970
15
0
1
anno it says it has done it and says complete but no restore its ok as when a user deletes a file its gone we don't need the restore file part
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
You should also know that when moving a file if the last update query fails on the receiving server, the sending server will delete the file but the database will not be updated. You will end up with the file in the new server and the database pointing to the old server (and the old server will delete the file). If you clean up orphan files, you will delete files with this problem.

The receiving files doesn't check the md5 after receiving the file either.

Also, if you move a file all current downloads reading from this file will fail and download managers won't be able to resume.

A tip for everyone editing this code (and for Adam too); assume that every php process may be killed at any time, assume that ALL mysql queries will fail and ALL I/O operations will fail. Use transactions on the database or make checks after every insert/update and always check for errors when reading/writing files.