Is there any way to map filenames being handled by rsync between local and remote? - rsync

I use rsync to copy photos from various smartphones into a central photo collection, but I keep photos in my central collection sorted into per-year directories. However, the phones all use a common DCIM directory for photos of all years. I'd like to tell rsync that ???_YYYY* files belong under the YYYY/ directory, but I don't see a clean way to do that?

Related

Having multiple folders be "desktop" folders

I have two disk drives on my PC (one SSD and one HDD) and basically what I want to do is to have files from both of these drives in my desktop.
Currently my desktop folder is in the SSD and I want to have direct access from the desktop to some of my files in the HDD. One solution may be to just create a link in the SSD folder to the HDD folder, but I should do this for every folder/file I want on the dekstop.
So, is there a better way to do this? Is there a way to create another desktop folder on the HDD (or some analogous action that brings the same result)? I'm using Windows 10.
You cannot have multiple Desktop folders, you can have just one Desktop folder at once, but you can move the whole Desktop folder to another location or drive. Just right-click the Desktop folder inside your "User folder" (eg: your name/nickname probably) and select "Properties", then in the "Location" tab "Find Target..." (choose the new location/path) and click on "Move..." button. All your Desktop files will be moved there (the entire folder actually).
Bye.

Is it possible to use rsync to sync all files of a given type recursively?

Every iOS device we have automatically uploads photos and videos to its own folder inside an SMB share on our Ubuntu box.
On my mac, this would be /Volumes/Ironman/familyMedia/<iosdevice>
So each device has a folder under /familyMedia
If I wanted to move all of the video files from each device's sub-folder into a single folder: /familyMedia/videos while preserving all of the meta data and date information for the file (rsync -azvp), could I do this with rsync.
Basically rsync would find all *.mov files in the familyMedia folder structure, recursively, and move them to one folder.
Possible?

When people mention storing files on the File System, is that referring to a folder within the app?

I need to store pdf files that will keep increasing with time on a folder for my app. But I'm not sure which method is consider 'good practice' between if I should store it in a folder within the project architecture (i.e. inside Content folder) or in a folder outside the app. I tried searching online but most people just mention 'File System' and don't give examples on where do they store it.
So my question is, when people mention storing files on the File System, do they usually mean storing it in a folder inside the app (like Content folder) or do they mean storing it in a folder outside the app?
For example: let's say my apps folders/files are within the container folder: /Container/AppFolder/. Should I store the pdf files on the apps Content folder (i.e. /Container/AppFolder/Content) or should I create a new folder OUTSIDE the apps folders to hold these pdf files? (i.e. /Container/PDFFiles, so basically two folders within the container folder - one folder for the pdf files and the other folder for the app)? Which one is consider a good practice? I have considered just putting these files on the Content folder but as the amount of files keep increasing I'm not sure if is bad practice.
Thanks in advance.
You can put it where ever you want on the server, the program will just need proper permissions to that location (I use the IO namespace). However you should put thought into how to organize the files and folders. Is each file to be tied to a specific ID or just all in 1 folder? Think of things you'll need to handle like invalid file names (special characters), duplicate file names etc. Is the location strictly 1 way (upload only)? Or are you enabling download functionality? If you have download functionality stress security, probably creating a download.aspx page specifically for handling download requests and authentication.

Delete Images From WordPress Media Library

I am unable to view any of the media library documents in the grid view. I can see them in the normal list view. I am also unable to upload any new media files. I have noticed that there are some strange no title files which I think are the cause of the issue but i am unable to delete them as there is no edit or delete button next to any of these screen-shot. My question is is there a way to delete these odd files from the database?
WordPress media files are not actually stored in the database. They are stored under a folder structure in your web root folder.
If you can make an FTP login, you can get rid of the odd media files as follows:
Make FTP login
Navigate to the wp-content/uploads folder
Under the uploads folder, you will find folder/s like 2016, 2015 etc. (depending on how old your site is)
Within each year, you will find monthly folders
Within each monthly folder, you will find the media files (that you uploaded during that month/year)
Browse around to find the offending files and delete
Hope this works for you.
Edit: You can also try one of the following plugins:
https://wordpress.org/plugins/enhanced-media-library/
https://wordpress.org/plugins/media-library-plus/

Where to store images for albums?

I am creating a module of my website where I can display images in "albums", much like facebook.
For storing/grouping images, I planned on having them in the ~/Images folder inside my application's structure. Is this considered bad practice, or will it open up my application to any security vulnerabilities? I read that you shouldn't place things like this in your site structure, but I don't quite understand why (or if this is the same scenario).
Therefore, albums would be grouped as...
~/Images/album1, ~/Images/album2, etc.
Is this an appropriate thing to put inside App_Data, or is there a more 'preferred' location for things such as this?
Sorry if this is a trivial question.
All three of the answers here are good. There is no preferred storage for uploaded images, it's all up to you based on your requirements.
As Henhealg says, don't store them in App_Data. If you put them here, they will not be accessible from the web. For example, the following would not render an image even if the path was correct:
<img src="/App_Data/album1/image1.png" alt="" />
One option is to have your local ~/Albums directory mapped to a different folder accessible to the web server, like sylon says. This keeps the images out of the directory where your MVC app is served from, but "pretends" that they are there. If you control IIS and can set up a file share, this may be an option for you.
Also, like XToro says, storing them in a SQL database is an option. Storing here is flexible because you don't have to worry about folder or file name collisions. Multiple users can each have albums and files with the same names, yet they won't collide because they don't occupy filesystem space the same way normal files do. If security is important to your app (not showing photos or albums to unauthorized users), having them in a SQL table makes this fairly easy.
However if you are not as worried about security or file naming collisions, you can just as easily store them in your MVC app's ~/Images or ~/Albums directory.
Depending on the performance of your server, you may want to consider storing your images into a database using BLOB
https://dev.mysql.com/doc/refman/5.0/en/blob.html
Images can be easily sorted, organized, categorized without the need to worry about folder structures and folder permissions. Simply use your PHP/AJAX/language of your choice to provide the authentication and choose which files you wish to display.
This way, each image can have it's own fields (as many as you want) like the user who posted it, the original filename, a caption, the album it belongs in etc etc
Since you can easily as a user check where the images are stored once the application is in production, where you store the images does not matter as much as what permissions you set to the folder(s) that the images are stored in.
I would use file system as you are saying but store it outside of the application folder as you are saying it is bad practice. I agree with this - when i do deployments I prefer to delete everything and drop in the new code and keep the web.config file that way I always have a clean environment and it is much easier to get started from scratch without having to worry about what I need to back up or bring from previous install.
I would use IIS to map the directory into my solution wherever I desire from a network share storage or whereever you want to safely keep your albums.
e.g. D:\MySafeStorage\Albums\ map to your website's ~\Albums\ when your website is in C:\inetpub\MyWebSite\

Resources