keep directory but delete files in it with dropbox bash api - bash

wp-dropbox is a directory in my dropbox.
Dropbox-Uploader/dropbox_uploader.sh delete /wp-dropbox
The command delete the wp-dropbox and all files in it.
How can i keep the directory --wp-dropbox,at the same time to delete all files in it?
Dropbox-Uploader/dropbox_uploader.sh delete /wp-dropbox/*
The above command can't achieve my target.

The Dropbox API doesn't offer the ability to delete all of the files in a folder without deleting the folder itself. We'll consider it a feature request.
Workarounds:
List all of the files and delete them specifically.
Delete the folder entirely, and then recreate just the folder.

Related

Temporary tmp files created by Inno Setup in destination directory while installing

One of my customers reported that my app installer creates a temp file like is-XXXXX.tmp in the {app} directory, which are identified by anti-virus app as malware. The temp file would only live for a very short time, so I can't make a copy of it. My customer ask me to send him a copy of the temp file to make sure there is no harmful code inside it. Is there any method to copy this temp file out on installation? Thanks!
When Inno Setup is extracting files to their destination folders, it always does that first by storing them to the file names like is-XXXXX.tmp. Only then, it renames them to their actual file names.
So all those files are actually the files that your customer has in the destination folder once the installation completes.

move files to .zip archive in windows command line

I wanted to know how to move files to a .zip archive. I'm using this code: xcopy C:\Folder C:\AnotherFolder\zippedFolder.zip. This copies the files from C:\Folder DIRECTLY into the archive, but I want to have that file in the archive (so i can doubleclick the archive and see the file unopened).
Want to do this to create an excel file with a .cmd
Use -m to import a file to a ZIP archive.
I found this on StackOverflow maybe it helps you.
How to move a file in to zip uncompressed, with zip cmd tool
But be careful it deletes the source file after it adds it to the archive. See the link for more details.
UPDATE
Instructions from this site. http://linux.about.com/od/commands/l/blcmdl1_zip.htm.
-m moves the specified files into the ZIP archive; actually, this deletes the target directories/files after making the specified ZIP archive.
If a directory becomes empty after removal of the files, the directory is also removed. No deletions are done until zip has created the archive without errors. This is useful for conserving disk space, but is potentially dangerous so it is recommended to use it in combination with -T to test the archive before removing all input files.
zip -m yourfile zip.file

Ignore desktop.ini files in all subdirectories [GitHub]

I have a folder that sync with google drive. So every folder and subfolder have a desktop.ini file.
I'm trying to make Git (GitHub) to ignore this desktop.ini files by adding this:
**/desktop.ini
desktop.ini
**/*/desktop.ini
To my .gitignore file. I added them one by one, combined, etc, and nothing. How I ignore dekstop.ini files in all subdirectories of my project?
Perhaps make use of the .git/info/exclude file to list all files that should be ignored.
It should work to exclude files such as desktop.ini However, it has the drawback that each member of the team will have to add the rule manually since it is not committed to the repo. Thus, other team members might eventually also commit the desktop.ini files if they are not careful
Try adding the below code to your ~/.gitconfig by running the following command:
vi ~/.gitconfig
[core]
excludesfile = /Users/<username>/Desktop/git_ignore_files.txt
And put the following types in the file that you mentioned in the [core] file like mentioned below
desktop.ini
*.swp
.DS_Store

Move files from multiple folders to multiple folders in Linux

How can I move files from multiple folders to another location. For example if I have 3 folders with name /test/folder1, /test/folder2, /test/folder3 and I want to move the contents of these folders into another location like /temp/folder1, /temp/folder2 /temp/folder3 using a script. I do not want to move these folders, instead I want to move the files inside these folders. Please Help
Something like
cd test
for dir in folder*; do
mv "$dir/*" "/temp/$dir"
done

How can I commit a duplicate copy with new folder name into SVN using SCToolbarButton on MAC?

I was trying to copy a folder in SVN with little modification of the files and the folder name itself. I tried to add the new folder, but the a message box which says "the folder is under sub-version control" comes. Which in turn doesn't allow me to commit into SVN.
I tried to change the file modification date of all files in the new folder, but didn't work. Can you please help me?
Thanks
I found the solution and I would like to share it here.
Previously there was a file with an extension of .svn in every folder I wanted to commit and that is why the SVN says "It is already under version control". now I remove them successively for each folder and sub-folder using ls -ls just to see whether the file with .svn is there, and rm -.svn

Resources