Samba Recycle foldername format - samba

Samba doc states that you can use variables (section Variable Substituion) to concat strings. We use this feature to generate a (not so) userfriendly recycle folder. Each department gets a share using their department number. See /etc/samba/smb.conf:
# Department 101
[101]
path = /srv/samba/data/departments/101/
read only = no
hide unreadable = yes
valid users = #"MYDOMAIN\NetworkDrive_FILESERVER_101"
# Enable the recycle bin
vfs object = acl_xattr recycle
recycle:repository = /srv/samba/data/departments/101/#recycle/%U-%t
recycle:touch = Yes
recycle:keeptree = Yes
recycle:versions = Yes
Using /srv/samba/data/departments/101/#recycle/%U-%t generates folders within \\fileserver.domain\101\#recycle\ with subfolders for each username and timestamp. Unfortunatley samba only offers a timestamp including seconds (%t or %T). This results in a big folder mess. With 6 users and a retention period of 14 days we already got 1602 folders like that.
fileserver:/srv/samba/data/departments/101/#recycle# ls -l
drwx------+ 3 MYDOMAIN\user2 MYDOMAIN\domain users 22 Sep 30 08:46 user2-20210930_084630
drwx------+ 3 MYDOMAIN\user2 MYDOMAIN\domain users 22 Sep 30 10:06 user2-20210930_100617
drwx------+ 3 MYDOMAIN\user2 MYDOMAIN\domain users 22 Oct 1 09:02 user2-20211001_090246
drwx------+ 3 MYDOMAIN\user2 MYDOMAIN\domain users 26 Oct 1 09:04 user2-20211001_090450
A format string for only the day or the hour would already mitigate this problem. Any idea how to solve this?

Related

How to select dynamical every month different source folder in SSIS

Scenario : Actual i want to see that one when Sep 6 only data load for source folder sep6 and tomorrow SEP 7 then data load form SEP 7 folder only then day after tomorrow SEP 8 mean data load from sep8 folder only but how ?????
I would do this by populating a variable from a C# script task. You can generate date/time strings very easily in a script task. E.g.:
Dts.Variables["User::FirstThreeCharsOfMonthNameUpper"].Value = DateTime.Now.ToString("MMM").ToUpper();

Missing Firebase app_update events

I'm seeing huge difference for app_update events automatically sent by Firebase and real conversion of user base to newer version when it's released.
For example 5 days during release of new version: 120 events VS 3k users (x20 difference)
I did check another "alpha" update with data exported to BigQuery:
Count app_update events (to any version):
SELECT
COUNT(user_pseudo_id)
FROM
`analytics_151378081.events_*`
WHERE
_TABLE_SUFFIX BETWEEN '20190820' AND '20190827' AND
event_name = "app_update"
---|---
1 | 49
Count users with new version who's first app launch was before this version was pushed to alpha:
SELECT
COUNT(DISTINCT(user_pseudo_id))
FROM
`analytics_151378081.events_*`
WHERE
_TABLE_SUFFIX BETWEEN '20190820' AND '20190827'
AND app_info.version = "0.4.2.1"
AND user_first_touch_timestamp < 1566259200000000
--|---
1 | 73
So it's 49 events (to any version) VS 73 "old" users using new version.
Is anyone seeing the same?
My platform is AndroidTV and a lot of sessions do not have UI (TV Input Framework integration through service)

How do I fetch data for a machine running log with different 'start' 'stop' entry in mysql?

My application keeps track of machines that are 'started' and 'stopped' as many times as needed, and this information is saved in the same table with the fields machine_ID, timestamp, entry_type(start/stop).
A start creates a row, and a stop creates a different row.
Sample start row : M1 - 2019-06-27 12:08:30 - 'start'
Sample stop row : M1 - 2019-06-27 14:30:05 - 'stop'
I need to be able to display:
1) All currently running machines (Machines that don't have a stop entry after the latest start entry)
2)A timeline of the previous machine activity preferably chronologically. Eg Machine 1 started: 09AM stopped 10 AM, Machine 2 started: 1pm, stopped 2pm, etc.
I imagine a result table as follows would be what I need but I can't understand how to build a query to fetch it.
'M1 - 2019-06-27 12:08:30 - 'start''
'M1 - 2019-06-27 14:30:05 - 'stop''
'M1 - 2019-06-27 16:00:00 - 'start''
'M1 - 2019-06-27 16:30:00 - 'stop''
'M2 - 2019-06-27 16:00:00 - 'start''
'M2 - 2019-06-27 16:30:00 - 'stop''
I plan tp use PHP to parse through such a table.
I am unable to alter the table structure in any way.
I believe the general principle behind solutions to this kind of problem has been well documented, however, not knowing how to refer to it, I am unable to do my own research.
Thanks.

Rails activerecord possible delay with big tables

I have Message model which have like a tons of fields and around 10 million entries in the table.
Now i also have an SomeItem model which looks like this(it have just 1000 entries):
class SomeItem < ActiveRecord::Base
belongs_to :item, :polymorphic => true # "Message" is one of the item types
end
now in have these two consecutive lines of code which bother me:
m = Message.new(:fild_one => 1, ...)
m.save
s = SomeItem.create(:item => m)
Now if see m is getting saved in the database fine at: Sat, 05 Oct 2013 15:01:06 UTC +00:00 and s at Sat, 05 Oct 2013 15:01:23 UTC +00:00 and thats fine.
but when i do:
s.item_type it gives me "Message" which is fine , but s.id it gives me nil in 3 out of
of 1000 entries.
So my question is:
Is there an kind of delay that prevents m created in the previous line to be used in the s created in the next line.
NOTE:
1) Message table is huge containing millions of entries
2) SomeItem table is small containing just 1000 of entries
3) As per me understanding rails execute these two sentences sequentially , but that does not explain this behavior.
Anyone noticed this before and if yes and if its a known thing what can be done to prevent this?
Thanks in advance. I understand the question looks silly , but its a real life scenario and is happening on my live project.

Query that returns only records that do not match on a specific field

I am not an Access person, just trying to write what I think is a simple query to do the following:
I have two tables in my database, imported from two separate SharePoint lists. So I do not have control over the format of the data. I will call one table the MASTER table and one table the SUBSET table. The MASTER table contains a complete list of all possible values that could appear in the SUBSET table.
Both tables have a field that contains a URL, but these fields are different data types. In the MASTER table, the URL field's data type is Text. In the SUBSET table, the URL field is of data type Hyperlink.
In addition, it is possible that some values in the SUBSET URL field do not exactly match the matching value in the MASTER URL field. So, if the MASTER URL is http://abc.example.com the SUBSET URL may contain additional information, like http://abc.example.com/home.apsx for example.
What I need is a query that returns all records from the MASTER table that do not have a matching URL record in the SUBSET table.
The desired output is a list of all RequestAccessEmail values that do not have a matching URL in the SUBSET table.
For each RequestAccessEmail value, include it in query results only if the associated URL value has no match in the SP Permissions Cleanup Tracking URL field.
Internal Site Owners
ID
Url
RequestAccessEmail
Attachments
1478
http://teamsites.example.com/sites/itfrance
First.last1#example.com
0
1673
http://teamsites.example.com/sites/PricingSupport
First.last2#example.com
0
1652
http://teamsites.example.com/sites/POProjectMgmt
First.last3#example.com
0
1655
http://teamsites.example.com/sites/POSTeam
First.last4#example.com
0
1741
http://teamsites.example.com/sites/rsa6x
First.last5#example.com
0
1218
http://teamsites.example.com/sites/EMEAProjectSupport
First.last6#example.com
0
65
http://projectsites.example.com/sites/folsom
First.last7#example.com
0
1595
http://teamsites.example.com/sites/NBPCA
First.last8#example.com
0
1664
http://teamsites.example.com/sites/prepaiddev
First.last9#example.com
0
1634
http://teamsites.example.com/sites/patchmgmt
First.last10#example.com
0
1961
http://os.example.com/sites/manager
First.last11#example.com
0
ID
Name
URL
8
CFPB AuditsDOMAIN_e0117427.xml
http://teamsites.example.com/sites/itfrance/home.aspx
9
St. Pete Legal DepartmentDOMAIN_e0117427.xml
http://teamsites.example.com/sites/PricingSupport
10
Retail Contracts (7)DOMAIN_e0117427.xml
http://teamsites.example.com/sites/POPProjectMgmt
11
China HR SharesDOMAIN_lc23494.xml
http://teamsites.example.com/sites/ChinaHRShares
12
Client LoyaltyDOMAIN_e1033221.xml
http://teamsites.example.com/sites/clientloyalty
13
eZoom! Human Resources R1.1DOMAIN_e1007952.xml
http://teamsites.example.com/sites/ezoom-hr
14
IntercompanyDOMAIN_e0119924.xml
http://teamsites.example.com/sites/intercoproject
15
NDMS Mentoring ProgramDOMAIN_e1033265.xml
http://teamsites.example.com/sites/NDMSMentoring
16
Human ResourcesDOMAIN_e0015957.xml
http://teamsites.example.com/sites/HR
17
International Human ResourcesDOMAIN_e1019184.xml
http://teamsites.example.com/sites/GlobalHR
18
Site Title FSG Resource Central DOMAIN_e0102084.xml
http://teamsites.example.com/sites/ResourceCentral/SitePages/Home.aspx
19
TAGDOMAIN_e1022064.xml
http://teamsites.example.com/sites/TAG/SitePages/Home.aspx
20
WP Employee_Community EngagementDOMAIN_e1034583.xml
http://teamsites.example.com/sites/WPEmpEngmt
21
Legal (6) - Root Site (reviewed all subsites except CID- DOJ- ACI 2011)DOMAIN_e0117427.xml
http://legal.example.com
22
Consulting Services Client PortalDOMAIN_e1035127.xml
http://clientportal.example.com/sites/consulting/default.aspx
23
YMCA Fitness ChallengeDOMAIN_e1035127.xml
http://projectsites.example.com/sites/Morgano/default.aspx
24
OSNETDOMAIN_e0000185.xml
http://os.example.com/Pages/default.aspx?sdupgwelredir=1
25
USVS_ Government SolutionsDOMAIN_e0113967.xml
http://infoport.example.com
26
Global ServicesDOMAIN_e0113967.xml
http://teamsites.example.com/sites/GlobalSvcs/default.aspx
27
Check Training _ Quality ServicesDOMAIN_e0113967.xml
http://teamsites.example.com/sites/QATrain
29
AutoSuites ArchiveDOMAIN_e0067145.xml
http://sp-archives.example.com/sites/autosuite/SitePages/Home.aspx
30
VCI Client SiteDOMAIN_e0067145.xml
http://clientportal.example.com/sites/VCI/SitePages/Home.aspx
31
VCI Internal SiteDOMAIN_e0067145.xml
http://teamsites.example.com/sites/VCI-IUO/SitePages/Home.aspx
See if something like this works for you:
SELECT Distinct m.URL
FROM [Internal Site Owners] m, [SP Permissions Cleanup Tracking] s
WHERE s.URL Not Like "*" & m.URL & "*"
You will need to paste the SQL in SQL View of the query design window.
The query asks for rows where the master URL is not like the subset URL, so http://abc.example.com will match http://abc.example.com/home.apsx, but not http://home.abc.example.com. The format of a hyperlink type is usually display text#http://example.com#, so http://example.com in the master will match.
Edit re data and comments
SQL:
SELECT DISTINCT m.RequestedAccessEmail, m.URL
FROM [Internal Site Owners] AS m, [SP Permissions Cleanup Tracking] AS s
WHERE s.URL Not Like "*" & [m].[URL] & "*"
New version from sample data:
SELECT [Internal Site Owners].RequestAccessEmail FROM [Internal Site Owners]
WHERE ID NOT IN (
SELECT [Internal Site Owners].ID
FROM [Internal Site Owners], [SP Permissions Cleanup Tracking]
WHERE [SP Permissions Cleanup Tracking].URL
Like "*" & [Internal Site Owners].[url] & "*")