Author |
Message |
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Sun Feb 27, 2011 10:18 pm Post subject: move instead of copy on replication(augment)? |
|
|
is it possible to augment a target with new files in source and then delete the source files that just got copied over?
thanks a bunch. |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Mon Feb 28, 2011 12:12 pm Post subject: |
|
|
i found a way to do it, which is by runnign a batch file script after the profile executes (advanced profile settings), with the following in the batch file :
ECHO Y | DEL Z:\BlackBerry\camera\*.* /s
(where folder is your specific source folder of course)
thanks |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
Posted: Tue Mar 01, 2011 4:48 am Post subject: |
|
|
Hi, make sure you delete the files only if the execution had no errors, that is, exit code is 0. ViceVersa passes the exit code to the script. thanks _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Tue Mar 01, 2011 10:24 am Post subject: |
|
|
thanks for pointing that out, i modified the batch file to the below, is that correct? for example, i dont know whether i need to do more processing to get access to the exit code from the viceversa script that runs before?
IF ERRORLEVEL 0 ECHO Y | DEL Z:\BlackBerry\camera\*.* /s |
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Tue Mar 01, 2011 10:43 am Post subject: |
|
|
and if viceversa script encounters an error, is teh exit code going to be positive number or negative number i.e. "IF ERRORLEVEL construction has one strange feature, that can be used to our advantage: it returns TRUE if the return code was equal to or higher than the specified errorlevel." |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Thu Mar 03, 2011 12:25 am Post subject: |
|
|
thanks for all the info! im pretty sure the following shoudl be fine now:
@ECHO OFF
IF "%VV_EXIT_CODE%" == "0" GOTO ACTION
ECHO Profile did not indicate success, file deletion will not be executed.
GOTO END
:ACTION
ECHO File deletion will be attempted.
ECHO Y | DEL Z:\BlackBerry\camera\*.* /s
:END
@ECHO ON |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
Posted: Thu Mar 03, 2011 2:00 pm Post subject: |
|
|
Hi,
yes, that should be fine, test it with a test folder by canceling the copy to see if the files are not deleted in that case. Also test it if you do not execute the profile but only compare source and target.
thanks _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Thu Mar 03, 2011 3:55 pm Post subject: |
|
|
contrary to expectations, deletion is triggered when compare is done without execution in viceversa
(1 below).
ill jsut be aware of that, i dont mind that very much, because im automating the execution with vvengine anyway, so always gets execution after comparison.
more importatnly, as needed, script does NOT trigger deletion action
a) when copy is cancelled in viceversa execution,
b) and if the target folder is not accessible
(2 and 3 below)
and, deletion is triggered when copy is successful.
(log not appended)
************************************************************
1) Profile Started.
************************************************************
Version: ViceVersa PRO 2.5 Build 2502 (SN278) [Registered][Kristjan-L...]
Command Line: "C:\Program Files\ViceVersa Pro 2\ViceVersa.exe"
System: Windows 7, (Media Center Edition), (Tablet PC Edition), (x86-32 Processor) v6.1 Build:7600
User: EDONICS.LOCAL\Kris
Computer: Diffusion.edonics.local
**** Profile: E:\xyz\appsets\viceversa\picsnu.fsf
**** - Folders -
**** Source: "Z:\BlackBerry\camera\"
**** Target: "T:\vet pics\mobnu\"
**** Include Subfolders: Yes
**** Exclude files: "BBThumbs.dat"
**** Exclude hidden files
**** Exclude system files
**** - Comparison Settings -
**** Comparison Type: Size and Timestamp
**** Ignore 2 seconds difference
**** Ignore 1 hour difference
**** - Execution Settings -
**** Method: Replication (Augment Target)
**** Log File: "C:\ProgramData\ViceVersa PRO 2\picsnu.log" (max 10000 KB)
**** No archive for deleted/replaced source files
**** No archive for deleted/replaced target files
**** Run custom scripts after execution (script: E:\inventions\readygo\trunk\delmobpics.bat)
Checking source Z:\BlackBerry\camera\ ...
Total found: 0
Checking target T:\vet pics\mobnu\ ...
Total found: 53
Comparing ...
Comparing done.
- Status Summary -
- Total Files - Source: 0 (0) - Target: 52 (92.04MB)
- Excluded Files - Source: 0 (0) - Target: 2 (3.81KB)
- Matched Files - Source: 0 (0) - Target: 0 (0)
- Single Files - Source: 0 (0) - Target: 50 (92.03MB)
- Newer Files - Source: 0 (0) - Target: 0 (0)
- Older Files - Source: 0 (0) - Target: 0 (0)
- Total Subfolders - Source: 0 - Target: 1
- Excluded Subfolders - Source: 0 - Target: 1
- Matched Subfolders - Source: 0 - Target: 0
- Single Subfolders - Source: 0 - Target: 0
Running script E:\inventions\readygo\trunk\delmobpics.bat
Script Output:
File deletion will be attempted.
Z:\BlackBerry\camera\*.*, Are you sure (Y/N)? Y
End Script Output
Script return code: 0
************************************************************
2) Profile Started.
************************************************************
Version: ViceVersa PRO 2.5 Build 2502 (SN278) [Registered][Kristjan-L...]
Command Line: "C:\Program Files\ViceVersa Pro 2\ViceVersa.exe"
System: Windows 7, (Media Center Edition), (Tablet PC Edition), (x86-32 Processor) v6.1 Build:7600
User: EDONICS.LOCAL\Kris
Computer: Diffusion.edonics.local
**** Profile: E:\xyz\appsets\viceversa\picsnu.fsf
**** - Folders -
**** Source: "Z:\BlackBerry\camera\"
**** Target: "T:\vet pics\mobnu\"
**** Include Subfolders: Yes
**** Exclude files: "BBThumbs.dat"
**** Exclude hidden files
**** Exclude system files
**** - Comparison Settings -
**** Comparison Type: Size and Timestamp
**** Ignore 2 seconds difference
**** Ignore 1 hour difference
**** - Execution Settings -
**** Method: Replication (Augment Target)
**** Log File: "C:\ProgramData\ViceVersa PRO 2\picsnu.log" (max 10000 KB)
**** No archive for deleted/replaced source files
**** No archive for deleted/replaced target files
**** Run custom scripts after execution (script: E:\inventions\readygo\trunk\delmobpics.bat)
Checking source Z:\BlackBerry\camera\ ...
Total found: 8
Checking target T:\vet pics\mobnu\ ...
Total found: 87
Comparing ...
Comparing done.
- Status Summary -
- Total Files - Source: 8 (379.07MB) - Target: 86 (202.23MB)
- Excluded Files - Source: 0 (0) - Target: 2 (3.81KB)
- Matched Files - Source: 0 (0) - Target: 0 (0)
- Single Files - Source: 8 (379.07MB) - Target: 84 (202.23MB)
- Newer Files - Source: 0 (0) - Target: 0 (0)
- Older Files - Source: 0 (0) - Target: 0 (0)
- Total Subfolders - Source: 0 - Target: 1
- Excluded Subfolders - Source: 0 - Target: 1
- Matched Subfolders - Source: 0 - Target: 0
- Single Subfolders - Source: 0 - Target: 0
---- Start Execution ----
---- Replication (Augment Target) (Source: Z:\BlackBerry\camera\ Target: T:\vet pics\mobnu\) ----
---- Start copying ----
-- Copying to target...
Copying file Z:\BlackBerry\camera\Cacioppo et al 2007.pdf <to> T:\vet pics\mobnu\Cacioppo et al 2007.pdf (14.67MB) [OK].
Copying file Z:\BlackBerry\camera\expsy inventions.rar <to> T:\vet pics\mobnu\expsy inventions.rar (75.40MB) [OK].
Copying file Z:\BlackBerry\camera\KrisExchange20110116.pst <to> T:\vet pics\mobnu\KrisExchange20110116.pst (36.83MB) [OK].
Copying file Z:\BlackBerry\camera\KrisExchange20110125.pst <to> T:\vet pics\mobnu\KrisExchange20110125.pst (53.54MB) [CANCELED].
-- Done: 3 (126.90MB) Err: 0 (0) Skipped: 0 (0) Tot: 8 (379.07MB) --
-- Average Transfer Rate: 369.97MB/Sec -- Elapsed Time: 0 sec
Re-comparing ...
---- Copying finished ----
---- End ----
- Execution Summary -
- Added Files - Source: 0 (0) - Target: 3 (126.90MB)
- Updated Files - Source: 0 (0) - Target: 0 (0)
- Deleted Files - Source: 0 (0) - Target: 0 (0)
- Added Subfolders - Source: 0 - Target: 0
- Deleted Subfolders - Source: 0 - Target: 0
- Status Summary -
- Total Files - Source: 8 (379.07MB) - Target: 89 (329.13MB)
- Excluded Files - Source: 0 (0) - Target: 2 (3.81KB)
- Matched Files - Source: 3 (126.90MB) - Target: 3 (126.90MB)
- Single Files - Source: 5 (252.17MB) - Target: 84 (202.23MB)
- Newer Files - Source: 0 (0) - Target: 0 (0)
- Older Files - Source: 0 (0) - Target: 0 (0)
- Total Subfolders - Source: 0 - Target: 1
- Excluded Subfolders - Source: 0 - Target: 1
- Matched Subfolders - Source: 0 - Target: 0
- Single Subfolders - Source: 0 - Target: 0
Running script E:\inventions\readygo\trunk\delmobpics.bat
Script Output:
Profile did not indicate success, file deletion will not be executed.
End Script Output
Script return code: 0
************************************************************
3) Profile Started.
************************************************************
Version: ViceVersa PRO 2.5 Build 2502 (SN278) [Registered][Kristjan-L...]
Command Line: "C:\Program Files\ViceVersa Pro 2\ViceVersa.exe"
System: Windows 7, (Media Center Edition), (Tablet PC Edition), (x86-32 Processor) v6.1 Build:7600
User: EDONICS.LOCAL\Kris
Computer: Diffusion.edonics.local
**** Profile: E:\xyz\appsets\viceversa\picsnu.fsf
**** - Folders -
**** Source: "Z:\BlackBerry\camera\"
**** Target: "T:\vet pics\mobnu\"
**** Include Subfolders: Yes
**** Exclude files: "BBThumbs.dat"
**** Exclude hidden files
**** Exclude system files
**** - Comparison Settings -
**** Comparison Type: Size and Timestamp
**** Ignore 2 seconds difference
**** Ignore 1 hour difference
**** - Execution Settings -
**** Method: Replication (Augment Target)
**** Log File: "C:\ProgramData\ViceVersa PRO 2\picsnu.log" (max 10000 KB)
**** No archive for deleted/replaced source files
**** No archive for deleted/replaced target files
**** Run custom scripts after execution (script: E:\inventions\readygo\trunk\delmobpics.bat)
[ERROR] Source: folder "Z:\BlackBerry\camera\" not found. The system cannot find the path specified.
Running script E:\inventions\readygo\trunk\delmobpics.bat
Script Output:
Profile did not indicate success, file deletion will not be executed.
End Script Output
Script return code: 0 |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
Posted: Tue Mar 08, 2011 4:33 am Post subject: |
|
|
Quote: | Contrary to expectations, deletion is triggered when compare is done without execution in viceversa
(1 below).
ill jsut be aware of that, i dont mind that very much, because im automating the execution with vvengine anyway, so always gets execution after comparison.
|
Thanks, I have confirmed this should be changed and exit code for case 1 should be 2 not 0. We'll fix this in the next release.
It should not happen if you select "Compare and execute" from the first (main) window.
thanks _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
Posted: Tue Mar 22, 2011 1:23 am Post subject: |
|
|
Hi,
Further analysis resulted in no need to change the exit code if the profile was not executed, because there is another variable that contains that info: it's called VV_EXECUTED and it's available since version 2.5
Change your script to perform the deletion only if the exit code is 0 and VV_EXECUTED is equal 1 and you should be fine.
thanks! _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
Cel123
Joined: 28 Dec 2010 Posts: 24
|
Posted: Tue Mar 22, 2011 9:58 am Post subject: |
|
|
thanks for letting me know!
@ECHO OFF
IF "%VV_EXIT_CODE%" == "0"
(
IF "%VV_EXECUTED%" == "1"
(
GOTO ACTION
)
)
ECHO Profile did not indicate success and-or comparison was not executed, so file deletion will not be executed.
GOTO END
:ACTION
ECHO File deletion will be attempted.
ECHO Y | DEL Z:\BlackBerry\camera\*.* /s
:END
@ECHO ON |
|
Back to top |
|
|
uservv-10 Guest
|
Posted: Sat Feb 20, 2016 7:08 am Post subject: |
|
|
Good script, thanks |
|
Back to top |
|
|
|