Backup Single File With A Different Name

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

Backup Single File With A Different Name

Post by aimy »

Hi.

Is it possible if I want to backup filename.xml as a filename_SUFFIX.xml:

Code: Select all

"App Settings"
 backupto "D:\SugarSync\Programs\Aimy\filename_S13018.xml","D:\My Programs\filename.xml";
How should I rewrite the command then?

Thanks.

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: Backup Single File With A Different Name

Post by FluxTorpedoe »

Hi'
You were probably looking for the copyas command.

With your example:

Code: Select all

"App Settings"
  copyas "*_S13018.?", "D:\SugarSync\Programs\Aimy", "D:\My Programs\filename.xml"";

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Backup Single File With A Different Name

Post by highend »

Code: Select all

"App Settings"
    copyitem "D:\My Programs\filename.xml", "D:\SugarSync\Programs\Aimy\filename_S13018.xml";
One of my scripts helped you out? Please donate via Paypal

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Backup Single File With A Different Name

Post by PeterH »

As aimy explicitely asked for backup, he maybe want to use functionality of it, like not to change attributes as date/time of the file?
W7(x64) SP1 German
( +WXP SP3 )

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

Re: Backup Single File With A Different Name

Post by aimy »

Thanks all.

Actually as the name implies, I want to backup only if there is need to.

Well anyway actually in my case, it will be always a replacement. So, both copyas and copyitem will suit my needs I think, thanks.

But how do I set it to overwrite the existing file if I using the copyitem command, anyone?

Thank you.

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

Re: Backup Single File With A Different Name

Post by aimy »

One more thing, is that possible for the S13018 suffix part, it derived automatically from the current computer name for example?

Code: Select all

 copyitem "D:\My Programs\filename.xml","D:\SugarSync\Programs\Aimy\filename_<computer_id>.xml";
How do I'm gonna achieve that?

Thank you.

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Backup Single File With A Different Name

Post by PeterH »

aimy wrote:One more thing, is that possible for the S13018 suffix part, it derived automatically from the current computer name for example?

Code: Select all

 copyitem "D:\My Programs\filename.xml","D:\SugarSync\Programs\Aimy\filename_<computer_id>.xml";
How do I'm gonna achieve that?

Thank you.
Use %computername% for computername. :D

If you could change naming to e.g. "D:\SugarSync\Programs\Aimy\%computername%\filename.xml" :arrow: use the same filename as the origin, you could use Backupto. Advantages:
- you have flags to pre-define reaction On Collision
- dates&times of the file were kept as original
W7(x64) SP1 German
( +WXP SP3 )

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

Re: Backup Single File With A Different Name

Post by aimy »

PeterH wrote:Use %computername% for computername. :D

If you could change naming to e.g. "D:\SugarSync\Programs\Aimy\%computername%\filename.xml" :arrow: use the same filename as the origin, you could use Backupto. Advantages:
- you have flags to pre-define reaction On Collision
- dates&times of the file were kept as original
Thanks a lot.

Works like a charm! ;)

PeterH
Posts: 2776
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Backup Single File With A Different Name

Post by PeterH »

aimy wrote:Thanks a lot.

Works like a charm! ;)
Fine: glad to hear :D
W7(x64) SP1 German
( +WXP SP3 )

Post Reply