View Single Post
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-18-2021 , 22:20   [ANY] FTP Ghosts Remover (Fix)
Reply With Quote #1

Quote:
Dedicated to the one Russian well-known and most popular game provider with the most bugged FTP in the world, which they unable to fix for more than 5 years.


Methodology:
When you are using FTP manager, such as FileZilla, WinSCP, etc. to upload plugins and stuff, it uses a trick by allocating space in the hidden file with the name started from "." (dot) until it actually finishes the uploading completely, then it renames the file into the final target.

When upload process is unexpectedly interrupted (e.g. due to a bad network), those hidden files remain there, so you are no longer nor able to upload the file with the same name neither remove those hidden file without:
- #1 accessing shell
- #2 ask for technical support

Now you have option #3 - to use "FTP Ghosts Remover".

Sign of "hidden (ghost) file": (dot) "." as a first or as the last character in the file name.

Settings (ConVars):
Located at: cfg/sourcemod/sm_ftp_ghost.cfg
PHP Code:
// Path for scanning. Default: all game folder. You can limit it by defining e.g. as 'addons/sourcemod/'
sm_ftp_ghost_path "../" 
Commands:
PHP Code:
// Lists ghost files to be deleted
sm_ghost_list

// Exclude this file from the delete operation
sm_ghost_exclude "path"

// Delete all ghost files
sm_ghost_delete 
Using:
- Enter in chat (or rcon) sm_ghost_list
It will list the ghost files found. Ensure no useful files are listed !!!
- Otherwise, add useful files to the exclusion list either by sm_ghost_exclude "path" command or via "data/ftp_ghost_exclusion.txt" file.

- Now, use sm_ghost_delete command. This is destructive, irretrievable operation!
Be attentive. The author is not responsible for your data loss.
All files listed with sm_ghost_list command will be deleted.
Success or failure of operation will be displayed.
Example of log:
Spoiler


Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money
Attached Files
File Type: sp Get Plugin or Get Source (sm_ftp_ghosts_remover.sp - 228 views - 5.1 KB)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 07-06-2022 at 15:48.
Dragokas is offline