Scheduled Backup

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Scheduled Backup

Post by aimy »

Hi.

Sorry if it sounds too simple, but how do I make a script that will automatically perform the backup of files/folders?

Let's say..

Code: Select all

source folder: D:/source/
target folder: E:/target/
backup frequency: Daily
Thank you.

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Scheduled Backup

Post by aimy »

Is this implausible? :(

eil
Posts: 1620
Joined: 13 Jan 2011 19:44

Re: Scheduled Backup

Post by eil »

currently not possible, 'cause schedule means automatic/by time start.
Win 7 SP1 x64 100% 1366x768

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Scheduled Backup

Post by j_c_hallgren »

aimy wrote:Is this implausible? :(
Not a script writer myself but based on what I've read/seen, it needs a task scheduler to trigger it as compared to XY doing so...it seem that XY scripts are more for things that you invoke rather than a time based event.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Scheduled Backup

Post by aimy »

thanks eil & jc..

ok, let's say I have a program to schedule the script..

so, will it be possible for me to run the XYplorer script using the command bat file?

If it is, how? What should the backup script looks like anyway? :oops:

Thanks.

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Scheduled Backup

Post by aimy »

Seems the auto backup is not available.

So, can pls someone help me on this..

I have these script assigned under the user button:

Code: Select all

"Copy Settings"
 copyitem "D:\Documents and Settings\S13018.TMMASTER\Application Data\Silicon Circus\PenguiNet\profiles.pnt","D:\SugarSync\Programs\Work\PenguiNet\profiles.pnt";
 copyitem "D:\Documents and Settings\S13018.TMMASTER\Application Data\Hot Keyboard\hotkeyb_4_0.data","D:\SugarSync\Programs\Hot Keyboard Pro\hotkeyb_4_0.data";
How do I extend the script so that when I pressed the button it will automatically copy from source to target or vice versa based on the file modified date?

Please assist.

Thank you.

aimy
Posts: 182
Joined: 26 Feb 2007 15:44

Re: Scheduled Backup

Post by aimy »

Anyone? :(

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Scheduled Backup

Post by Filehero »

Hi aimy,

why not taking this approach:
- create a User-Defined Command of category "Backup To"
- in Config/File Operations/Backup set the property "on name collisions" to overwrite if newer

What you need is already there (except automation).


Cheers,
Filehero

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Scheduled Backup

Post by Stefan »

aimy wrote:How do I extend the script [...] based on the file modified date?
I don't know, but i would try it like this, perhaps you can adopt this:

Code: Select all


  //get timestamp from an selected file:
  $file1 = "<curitem>";
  $time1 = report("{Modified}", $file1);
      
  //$file2 =
  //$time2 =
       
  msg "$file1<crlf>$time1";
       
---------------------------
XYplorer
---------------------------
C:\TEMPO\Neues Textdokument.txt
28.03.2012 13:29:44
---------------------------
OK   
---------------------------



        
  //==============================
  //compare timestamps:
          
  //(Here with example timestamps. In real get the timestamps as shown above)
  $t1 = "28.03.2012 13:29:44";
  $t2 = "28.3.2012 13:29:40";
         
  //format the timestamps to an compareable string:
  $t1 = formatdate($t1, "yyyymmddhhnnss");
  $t2 = formatdate($t2, "yyyymmddhhnnss");
           
         
  //compare the two strings numeric:
  $t2younger = compare($t1, $t2, "n");
  msg "Result of comparing t1 to t2:<crlf 2>IF t1 > t2? results in: $t2younger";
            
           
---------------------------
XYplorer
---------------------------
Result of comparing t1 to t2:

IF t1 > t2? results in: 1
---------------------------
OK   
---------------------------



  //==============================
  //do something with that result:
  if($t2younger==1){$t2younger="No";}else{$t2younger="Yes";}
  msg "1: $t1<crlf>2: $t2<crlf 2>If timestamp 2 younger?<crlf 2>$t2younger";
          

---------------------------
XYplorer
---------------------------
1: 20120328132944
2: 20120328132940

If timestamp 2 younger?

No
---------------------------
OK   
---------------------------
   

Post Reply