When calling a Python script from a PHP script, temporary file that is created on a console run, is not created via the
By : Dhanaashree PanPatil
Date : March 29 2020, 07:55 AM
it fixes the issue I bet your py script has some bug which couses it to break when called from inside PHP. Try code :
passthru('/usr/python/bin/python3 ../cgi-bin/tabular.py 1 2>&1');
|
Windows batch script to rename and delete files based on extension and time created
By : marcelino671
Date : March 29 2020, 07:55 AM
I wish this helpful for you If using powershell instead of cmd is an option, you could do the following: to delete the files: code :
get-childitem c:\path\to\xml -filter *.tmp | remove-item
get-childitem c:\path\to\xml -filter *.bad | where-object {$_.creationtime -gt (get-date).addminutes(-10)} | foreach-object {move-item $_.fullname ($_.fullname -replace '.bad','.xml')}
|
Batch script to delete older backup files in a folder created by date with the exception of the newest 5 files
By : video channel
Date : March 29 2020, 07:55 AM
I hope this helps you . You did already a quite good job on writing the batch file, but made some small mistakes. Using in first line ECHO ON helped to find those mistakes. code :
@ECHO OFF
for /f "usebackq delims== tokens=2" %%i in ( `WMIC OS GET localdatetime /format:value` ) do set localTime=%%i
set "YYYY=%localTime:~0,4%"
set "M=%localTime:~4,1%"
set "MM=%localTime:~5,1%"
set "D=%localTime:~6,1%"
set "DD=%localTime:~7,1%"
if %M%==0 set M=
if %D%==0 set D=
cd /d "%~dp0"
for /F "usebackq tokens=* skip=5" %%X in ( `dir .\%YYYY%\%M%%MM%\%D%%DD%\Backup-serversave-%YYYY%-%M%%MM%-%D%%DD%--*.zip /b /o:-d` ) do del .\%YYYY%\%M%%MM%\%D%%DD%\%%X
pause
|
Script for search and delete only files created by me in Google Drive shared folder
By : JimGo
Date : March 29 2020, 07:55 AM
around this issue You want to delete the files you created. The files are put in a shared folder. The files include the files which were created by several users. The files you want to delete are as follows. Files which were created 3 hours ago. In this case, there are the files which are created by you and other users. For the files which were created 3 hours ago, you want to leave only the latest file. While you follow the above condition, you want to delete only the files you created. You want to achieve this using Google Apps Script. From your script and question, I could understand like this. If my understanding is correct, how about this answer? Please think of this as just one of several answers. code :
function getOldFileIDs() {
// Old date is 3 Hours
var oldDate = new Date().getTime() - 3600*1000*3;
var cutOffDate = new Date(oldDate).toISOString();
// Get folderID using the URL on google drive
var folder = DriveApp.getFolderById('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
var files = folder.searchFiles('modifiedDate < "' + cutOffDate + '"');
var obj = [];
while (files.hasNext()) {
var file = files.next();
obj.push({id: file.getId(), date: file.getDateCreated(), owner: file.getOwner().getEmail()}); // Modified
}
obj.sort(function(a, b) {
var a= new Date(a.date).valueOf();
var b= new Date(b.date).valueOf();
return b-a;
});
obj.shift();
return obj; // Modified
};
function deleteFiles() {
var email = "###"; // Added
var obj = getOldFileIDs; // Modified
obj.forEach(function(e) { // Modified
if (e.owner == email) { // Added
Drive.Files.remove(e.id); // Modified
}
});
};
Drive.Files.remove(fileID);
try {Drive.Files.remove(fileID)} catch(e) {}
|
Powershell script to delete temporary internet files
By : Engel Gadon
Date : March 29 2020, 07:55 AM
Hope that helps I'm trying to delete the files of extension ".htm" in the temporary internet files (TIF) folder using powershell. But couldn't get far on this. , I would not bother with the FullName at all:
|