# Script movefiles.txt # Input argument - date var str date # Get a list of files not modified since $date. var str list ; lf -n "*" "C:\folder1" ( ($ftype == "f") AND ($fmtime < $date) ) > $list # Move files one by one. while ($list <> "") do var str file ; lex "1" $list > $file system move $file "C:\folder2" done
script movefiles.txt date("20090613")
> We generate about 1000 reports per hour on our webserver and > run a nightly script to remove these files. Unfortunately, that is not often enough > and need to have a script that we can run every hour > that removes old files (older than say 1 hr). > Can someone steer me to a solution that uses the system time, > and removes files from our "reports" directory that are older? Thx in Advance
# Script HourlyDelete.txt # Go to reports folder. cd "C:/hourly reports" # Collect a list of files that were CREATED more than an hour ago. var str list, file lf -r -n "*" "." ( $fctime < addtime(diff("-10000")) ) > $list # Delete each file in $list one by one. while ($list <> "") do lex "1" $list > $file echo -e "DEBUG: Deleting file " $file system del ("\""+$file+"\"") done
We want to move ( not DELET ) log files after every 5 minutes form one location to another. But also we do not want to move the log file which is currently active. Means we want to move the logfiles which are 5 minutes older than System Date. Can we get the Windows Script for the same, which we can use in the windows scheduler.
# Script MoveLog5min.txt var str source, destination, pattern # Create a time string that represents "5 minutes earlier" (subtract 05 mins, 00 seconds from current time). var str time set $time = addtime(diff("-0500")) # Collect a list of files matching $pattern in folder $source whose modification time is earlier than $time. var str list, file lf -n $pattern $source ( ($ftype=="f") AND ($fmtime < $time) ) > $list # Go thru files one by one. while ($list <> "") do # Get the next file. lex "1" $list > $file # Move file to $destination. system -s ("move /Y \""+$file+"\" \""+$destination+"\"") done
script "C:/Scripts/MoveLog5min.txt" source("C:/Log Directory") destination("C:/Moved Log Directory") pattern("*.log")
"C:/biterscripting/biterscripting.exe" "C:/Scripts/MoveLog5min.txt" source("C:/Log Directory") destination("C:/Moved Log Directory") pattern("*.log")
Member requests are more likely to be responded to.
Members can monitor the statuses of their requests from their account pages.
A CCM membership gives you access to additional options.