1st RUN..
2nd RUN
So that worked well and will suffice for my daily sync button, thanks!
I had this written out for my bi-weekly button prior to you responding and now I'm not sure how to modify the script to include this and to include the same text file(s) which will show the last synced dates for each source/target line and perhaps modify the script even further to eliminate the need for that open throw away clone.
sync "C:\SCANSNAP", "D:\SCANSNAP(Target)(1of3) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "C:\SCANSNAP", "E:\SCANSNAP(Target)(2of3) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "C:\SCANSNAP", "W:\SCANSNAP(Target)(3of3) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "R:\OAKVILLE", "W:\OAKVILLE(Target)(1of2) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "R:\OAKVILLE", "X:\OAKVILLE(Target)(2of2) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "S:\TORONTO", "W:\TORONTO(Target)(1of2) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
sync "S:\TORONTO", "X:\TORONTO(Target)(2of2) Synced on <date yyyy.mm.dd @ hh.nnam/pm>", 1, 0, 2, "kn";
Thanks again.
Sync folders questions
Re: Sync folders questions
If I'd need to do that my script would look like this
Code: Select all
// {src}<:>{dst}<:>{filters}
// Disable a specific job by prefixing it with: //
$jobs = <<<>>>
C:\SCANSNAP<:>D:\SCANSNAP(Target)(1of3)<:>"-\Note20\Music\"|"-\Note20\Audiobooks\"
C:\SCANSNAP<:>E:\SCANSNAP(Target)(2of3)<:>
C:\SCANSNAP<:>W:\SCANSNAP(Target)(3of3)<:>
R:\OAKVILLE<:>W:\OAKVILLE(Target)(1of2)<:>
R:\OAKVILLE<:>X:\OAKVILLE(Target)(2of2)<:>
S:\TORONTO <:>W:\TORONTO(Target)(1of2)<:>
S:\TORONTO <:>X:\TORONTO(Target)(2of2)<:>
>>>;
// ========================================================================
// == DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU ARE DOING ==
// ========================================================================
$jobs = regexreplace($jobs, "^//.*?(\r?\n|$)");
setting "BackgroundFileOps", 0;
$log = "";
foreach($job, $jobs, <crlf>, "e") {
$src = gettoken($job, 1, "<:>", "t");
$dst = gettoken($job, 2, "<:>", "t");
$dstPath = regexmatches($dst, "^.*\\");
$filter = gettoken($job, 3, "<:>", "t");
$date = <date yyyy.mm.dd @ hh.nnam/pm>;
// Pre-checks
if (exists($src) != 2) { $log .= "Src: " . quote($src) . " not found, skipping!" . <crlf>; continue; }
if (exists($dstPath) != 2) { $log .= "Dst: " . quote($dstPath) . " not found, skipping!" . <crlf>; continue; }
// Delete the last sync .txt file
$txtPath = gettoken($dst, 1, "\");
$txtPre = gettoken($dst, 2, "\");
$txts = quicksearch($txtPre . "*.txt /n", $txtPath, "|");
foreach($txt, $txts, "|", "e") { $result = runret(lax("cmd" /c DEL /F /Q "$txt"), "%TEMP%"); }
// Sync
if ($filter) {
sync "$src", "$dst", 1, 0, 2, "kn", 7:=$filter;
} else {
sync "$src", "$dst", 1, 0, 2, "kn";
}
new("$txtPath\$txtPre Synced on $date.txt");
}
if ($log) { text $log; }
One of my scripts helped you out? Please donate via Paypal
Re: Sync folders questions
Tried this and had to cancel the run. It seems I'm still unable to use XY while it is running and that I will need to run it in the throw away clone or fresh instance in order to use XY again?
Is there something further that I should configure?
Is there something further that I should configure?
Re: Sync folders questions
This has been said multiple times, you need a second instance if you don't want to block the main one during sync
One of my scripts helped you out? Please donate via Paypal
Re: Sync folders questions
I must have misunderstood this..
I thought the script running in the second instance was going to be all part and parcel of hitting the script button in the main instance.
Anyway, going to run this script again with the open throw away clone now and see how that goes.
Anyway, going to run this script again with the open throw away clone now and see how that goes.
Re: Sync folders questions
You could run that script in a throw-away clone if necessary, again: via scripting
The script I posted should be put in a .xys file (create a normal .txt one, rename it, e.g. in: Sync.xys)
Put Sync.xys in your XY scripts folder
Append one more line to that file (at the end, indented by 4 spaces):
Use a user defined button with this "script":
Edit the position parameters if necessary.
If you'd use "n" instead of "kn" in the two sync ... lines in the script file (to NOT keep the sync report open)
it would start a clone that loads and executes that script and automatically exits that second instance when done...
The script I posted should be put in a .xys file (create a normal .txt one, rename it, e.g. in: Sync.xys)
Put Sync.xys in your XY scripts folder
Append one more line to that file (at the end, indented by 4 spaces):
exit "n"; and save it again.Use a user defined button with this "script":
Code: Select all
run lax("<xy>" /new /readonly /win=normal,40,20,1200,800 /script="Sync.xys");
If you'd use "n" instead of "kn" in the two sync ... lines in the script file (to NOT keep the sync report open)
it would start a clone that loads and executes that script and automatically exits that second instance when done...
One of my scripts helped you out? Please donate via Paypal
Re: Sync folders questions
Okay, will give this a try..
Thanks!
Thanks!
Re: Sync folders questions
So, does it work as expected now?
One of my scripts helped you out? Please donate via Paypal
Re: Sync folders questions
I don't know yet. I had to put this on hold and keep using what I'm currently using. Once I know, I'll post back.
Re: Sync folders questions
FYI, there is a background switch available for SC sync now.
Re: Sync folders questions
Thanks! will check it out later.
XYplorer Beta Club