如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)

我想在命令提示符下运行以下.py脚本:

connect('weblogic','welcome','t3://localhost:7001')
exportMetadata(application='soa-infra', server='AdminServer',toLocation='C:\soa11g\New\abc_date.zip', docs='/**')
exit()  

但是,每当我执行它时,我都需要创建一个名称中包含sysdate的.zip文件,例如abc_10082015abc_10-08-2015 。 我怎样才能做到这一点?


I want to run the following .py script at the command prompt:

connect('weblogic','welcome','t3://localhost:7001')
exportMetadata(application='soa-infra', server='AdminServer',toLocation='C:\soa11g\New\abc_date.zip', docs='/**')
exit()  

However, whenever I execute it, I need to create a .zip file with whose name contains the sysdate, e.g. abc_10082015 or abc_10-08-2015. How can I do that?


原文:https://stackoverflow.com/questions/32494923
2024-05-07 20:05

满意答案

我通过从WebPI安装Web Deploy来解决此问题。 由于某种原因,当我仅独立安装Web Deploy 3.6时,服务未正确注册。 通过WebPI安装后,发布作业立即开始工作。


I fixed this by installing Web Deploy from WebPI. For some reason when I only installed Web Deploy 3.6 independently the services were not registered properly. After installing via WebPI the publishing job instantly started working.

相关问答

更多

Sitecore索引中的urllink通过“/ sitecore / shell /〜/ media / ...”返回媒体网址(urllink in Sitecore indexs returns media url with “/sitecore/shell/~/media/…”)

只是为了给这个更新。 Sitecore确认这是一个错误。 他们正在寻找解决方法,我会在他们这里更新。 谢谢。 -------------于15/12/2014更新---------------------- 门票现在关闭。 Sitecore的解决方案是将来从索引中删除这个“urlLink”字段(他们表示他们会要求这样做)。 原因是该链接应由LinkManager根据当前网站上下文生成。 但是,建立索引时站点上下文不存在(对于内容项目,您可以检查路径,但对于媒体项目则不能)。 当然,还有另一种解决方...

如何限制sitecore droptree字段仅接受媒体文件夹项目并且不允许媒体项目(How to restrict a sitecore droptree field to accept only media folder item and not allow media items)

您不能在DropTree中使用Include / Exclude TemplatesForDisplay / Selection。 看到这个stackoverflow答案 You can't use Include/Exclude TemplatesForDisplay/Selection with DropTree. See this stackoverflow answer

如何停止在Sitecore媒体库文件夹中上传WFFM媒体文件并获取上传媒体文件的字节数组(How to stop uploading WFFM media files in Sitecore Media library folder and get byte array of uploaded media file)

通常,您需要创建自己的“上传字段”,该字段继承自默认的wffm FileUploadField,并覆盖负责处理已发布文件的代码。 如果您需要另外处理此发布的文件,您可能还需要添加自定义表单保存操作。 你也可以使用这篇文章中的想法。 Typically you will need to create you own 'Upload field' inherited from default wffm FileUploadField and override code responsible for ...

sitecore媒体文件的Web部署问题(Web deploy issue with sitecore media files)

我通过从WebPI安装Web Deploy来解决此问题。 由于某种原因,当我仅独立安装Web Deploy 3.6时,服务未正确注册。 通过WebPI安装后,发布作业立即开始工作。 I fixed this by installing Web Deploy from WebPI. For some reason when I only installed Web Deploy 3.6 independently the services were not registered properly. ...

将大文件上传到sitecore媒体库(Upload large files to sitecore media library)

正如Martijn所说,没有任何内置功能可以自动检测到这一点,但是如果您知道文件很大(或者由于大尺寸导致上传失败),那么您可以手动“强制它”保存到文件中每个上传的基础。 您需要使用“高级上载”选项并选择“上载为文件”选项。 编辑:如果您能够使用YouTube,请考虑以下模块与Sitecore完美/紧密集成。 对于不同的提供商,还有其他几种方法可以实现相同的目标。 YouTube集成 YouTube上传器 As Martijn says, there is nothing built in to a...

Sitecore字段,用于从媒体库中选择具有上载文件功能的多个文件(Sitecore field for selecting multiple files from media library with the ability to upload files)

获胜者是...... Sitecore支持的答案: 在Email Experience Manager模块中,有一个名为“文件列表”的字段。 该图像显示Sitecore 8中的对话框和字段本身(下方)。 它具有搜索功能,支持多个文件并上传。 它将值存储为管道分隔的GUID(就像Treelist类似的字段)。 And the winner is.... the answer from Sitecore support: In the Email Experience Manager module t...

Sitecore - 根据要求获取有关媒体项的信息(Sitecore - Get information about media item on request)

您可以使用MediaManager.ParseMediaRequest方法获取媒体项: MediaRequest request = MediaManager.ParseMediaRequest(HttpContext.Current.Request); if (request == null) { return false; } Media media = MediaManager.GetMedia(request.MediaUri); 有一篇很好的博客文章解释了如何限制Sitec...

Sitecore配置问题(Sitecore Configuration issue)

该错误消息表明它正在尝试查找ContentSearch配置文件中引用的syncMaster更新策略 <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/syncMaster"/> 您的修补程序配置文件主动从配置中删除syncMaster更新策略。 <syncMaster> <patch:delete /> </syncMaster> 因此,删除该补丁文件, syncMaster将保留在配置中,因此...

Sitecore内部链接到媒体文件?(Sitecore internal links to media files?)

正如halbherz提到的那样 Sitecore.Context.Item["bodyText"] 是该字段的字面值。 它没有通过sitecore RenderField管道,因此没有链接被扩展。 如果要从后面的代码渲染字段,可以使用FieldRenderer类,如: Sitecore.Web.UI.WebContols.FieldRenderer.Render("bodyText", Sitecore.Context.Item) As halbherz mentioned the latte...

Sitecore媒体框架Ooyala 1.4 rev。(Sitecore Media Framework Ooyala 1.4 rev. 140411 is not pulling audio files from Ooyala backlot)

默认情况下,Media Framework Ooyala不支持音频。 您需要添加自己的音频模板并添加音频资产类型功能(导入,导出等)。 请遵循以下文档: http : //sdn.sitecore.net/upload/sdn5/products/sitecore%20media%20framework/14/sitecore_media_framework_1_4_integration_guide-a4.pdf 。 另外不要忘记音频ooyala播放器已被弃用,因此播放器V3不支持它。 http...

相关文章

更多

shell 脚本执行,出现错误bad interpreter: No such file or directory

出现bad interpreter:No such file or directory的原因 是文件格 ...

storm client command

最近在研究实时日志分析,storm确实不错,以下是命令参数: storm help Syntax: ...

How to set up Solr on Ubuntu 10.04 (or whatever)

How to set up Solr on Ubuntu 10.04 (or whatever) | ...

用‘button’跟‘text’组合代替‘file’,选择文件后点‘submit’,‘file’的值被清空

各位大虾晚上好,我有个问题想请教你们,我想美化html的file外观,但貌似现在还不能用css直接设计 ...

用SimpleDateFormat把字符串转换成Date的时候报NumberFormatException

今天用for循环产生多条线程去缓存里面取数据,数据就是字符串形式的日期,我如果用for循环连续的产生线 ...

Java 流(Stream)、文件(File)和IO

Java 流(Stream)、文件(File)和IO Java.io包几乎包含了所有操作输入、输 ...

xxx is not in the sudoers file解决方法

用sudo时提示&quot;xxx is not in the sudoers file. This ...

PHP 中dirname(_file_)

PHP 中dirname(_file_) 2007-5-3 16:00|查看: 19256|评论: ...

【HDFS】HADOOP DISTRIBUTED FILE SYSTEM

【HDFS】Hadoop DISTRIBUTED FILE SYSTEM THE CAST CLIEN ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本