Recovering deleted files from WinSCP - winscp

I accidentally deleted some logs files from my server from root user in WinSCP. In preference options, there was a checkbox option that was checked for "Moving files to recycling bin".
I can't find the recycling bin anywhere, I really need the logs back, is it possible to get the logs back from this said recycling bin? Where can find the path for this recycling bin?

In general, your files are lost. There's hardly any way to recover them.
See WinSCP FAQ Can I undelete remote file removed with WinSCP?
As for the option you refer to: That enables only confirmation prompt for deleting files (both local and remote) to recycle bin. But unless you have enabled the recycle bin for remote files, it has no effect.

Related

Delete files on a SMB3 share to recycle bin

I have a Synology NAS (DS1621+) in my local network. A shared folder XXX is crated with SMB3 and SMB2 MTU enabled. The "Enable Recycle Bin" option is also activated for this shared folder. And I can see there is a #recycle directory in this folder.
In my Windows10 Pro, I connect to my NAS by using "Map network drive" in Explorer. But when I try to delete something in this shared folder, it always makes a "delete permanent", and the recycle option is in gray (see image below).
I've learned that SMB protocol supports truly the recycling functionality. So how could I fix this problem?
Thanks for your help.
Solution
After searching in a Chinese forum, I find out that this is just a graphical misunderstanding. In fact, the file is NOT permanently deleted when "Enable Recycle Bin" is activated on NAS. It will be moved to #recycle directory on your shared folder, and you can access it through Synology DSM. So, you can delete any files in Windows on that SMB share without any worries about permanent lost. But in Windows, it always shows a warning panel of "permanent delete" when you do a removing action.
If you want to deactivate the warning panel of permanent delete in your Windows, you can go to your user foled in C:\Users\{username}, choose a system default folder, for example "Downloads". Right click on this folder, go to "Location" tab and change the location to your SMB share. In this case, the files you that you delete will be showed in Recycle Bin on your Windows desktop as usual.
References
简化操作:Win10删除群晖NAS文件不再显示【删除对话框】,Del即删除
From a windows point of view, every delete on a network share in permanent (not in windows recycle bin). It can't know that the NAS will do the move to its own recycle folder.

NT Authority/System can't see protected OS files

The Question:
Why can't the LocalSystem account (NT Authority\System) see files in the Recycle Bins or the Temporary Internet Files directory?
Background:
I created a scheduled task to run using the System account. The purpose of the task is to execute the Disk Cleanup Utility with predefined setting (for example: cleanmgr.exe sagerun:1). When it executes, it seems to run with no errors. But when I check the resources it's supposed to clean (Temporary Internet Files, Recycle Bin etc.), they're still there.
So I thought maybe cleaning up the two resources manually might work. I developed a console application in C# that clears the Recycle Bin and the Temporary Internet Files. I test it and it works just fine. But again, when I attempt to run it as a scheduled task with the System account, I run into the same issue again.
Following the log, it looks like when running the application with System account, it sees no files are in the Recycle Bin or the Temporary Internet Files directory.
Upon checking the Security tab for the Temporary Internet Files directory, it shows System as a full access account to that directory.
I'm so puzzled by this issue. I may be missing something but I assumed the LocalSystem account has the highest privilege on a machine. Is that not the case?

Is it safe to delete the files under /var/lib/azsec ? Azure VM

I logged to my CentOS 7 server ( Azure Virtual machine) this morning and found that it's running slow on space, so I'm looking for undesired log files and safe to remove files, so Is it safe to delete the files under /var/lib/azsec ?
Here's a screenshot of the folder:
/var/lib/ folders
Thanks in advance,
Actually, it's not safe to do that directly because if you want to check the log to find something indeed later and there will no log to find.
So I suggest you can make a backup of the log and store it in another place. Then you can delete it from the VM to make some space to use.

Restarting IIS on file changed

AFAIK IIS restarts, whenever any of the web.config files is changed.
I've created my own configuration files (my.config, with slightly different hierarchy). Is there any possibility to have IIS automatically (automagically :)) restarted, whenever any of these are changed, too?
EDIT: I've considered filesystem watchers, but I'm not sure where to put them.
You mean to say that whenever you change my.config iis has to be restarted automatically.
Maybe you can write a batch file to perform your iisreset functinality alone if you dont want the user to manually restart IIS. But even if you give a batch file the user still needs to execute.
quick and ugly fix would be put config files in bin directory.
btw. I don't believe I am writing this ;)
these changes restarts web app:
* web.config
* machine.config
* global.asax
* Anything in the bin directory or it's sub-directories
copy/pasted from here Common reasons why your application pool may unexpectedly recycle
Use SomeAssemly.dll.config which will be put into ~/Bin, automatic be read on app (re)start and cause app restart on edit.
Note that App.config in project becomes $(OutputAssembly).config on build

Not able to delete directory

I am having a frequent problems with my web hosting (its shared)
I am not able to delete or change permission for a particular directory. The response is,
Cannot delete. Directory may not be empty
I checked the permissions and it looks OK. There are 100's of files in this folder which I don't want.
I contacted my support and they solved it saying it was permission issue. But it reappeared. Any suggestions?
The server is Linux.
You can't rmdir a directory with files in it. You must first rm all files and subdirectories. Many times, the easiest solution is:
$ rm -rf old_directory
It's entirely possible that some of the files or subdirectories have permission limitations that might prevent them from being removed. Occasionally, this can be solved with:
$ chmod -R +w old_directory
But I suspect that's what your support people did earlier.
This could also be because your FTP client might not be showing the hidden files (like cache, or any hiddn files that your application might create), while the hidden files are preventing you from deleting the directory. (though, in your case, I am not sure if this is the cause .. .it could be permission issue with your hosting provider.. Webserver running as another user (like apache or www) combined with your directories having global write perms).
I assume that's a response from an FTP server?
Usually, a message from an FTP server really means it. If it says the directory is not empty, there might be certain files you cannot see that exists in the directory which maybe one of:
Your PHP/JSP/ASP/whatever scripts may run under a different user account thus creating files which you may not be able to see/delete
Is your hosting's web interface run under your FTP account? There might be conflicting permissions there if you manage some files from the web interface and then later via FTP.
Hosting server/operating system files created unintentionally e.g. from the hosting's web interface
If it comes from a script, write a one-time throw-away script that delete the files and that directory and then uploads and executes it.
And just to be sure, some FTP server doesn't support direct directory deletion, you need all the files first, is that the case?

Resources